283 lines
11 KiB
JavaScript
283 lines
11 KiB
JavaScript
|
"use strict";
|
||
|
(() => {
|
||
|
var exports = {};
|
||
|
exports.id = 3749;
|
||
|
exports.ids = [3749];
|
||
|
exports.modules = {
|
||
|
|
||
|
/***/ 203:
|
||
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
||
|
|
||
|
__webpack_require__.r(__webpack_exports__);
|
||
|
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
|
||
|
/* harmony export */ "default": () => (/* binding */ Homepage),
|
||
|
/* harmony export */ "getStaticPaths": () => (/* binding */ getStaticPaths),
|
||
|
/* harmony export */ "getStaticProps": () => (/* binding */ getStaticProps)
|
||
|
/* harmony export */ });
|
||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(997);
|
||
|
/* harmony import */ var react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__);
|
||
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(6689);
|
||
|
/* harmony import */ var react__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(react__WEBPACK_IMPORTED_MODULE_1__);
|
||
|
/* harmony import */ var _layouts_GeneralLayout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(6217);
|
||
|
/* harmony import */ var _components_general_PageHeadTags__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(4097);
|
||
|
/* harmony import */ var _functions_frontend_clientAuthUser__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(9922);
|
||
|
/* harmony import */ var _components_pages_docs_DocsAside__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(6000);
|
||
|
/* harmony import */ var _components_pages_docs_DocsGenereicHero__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9350);
|
||
|
/* harmony import */ var _package_shared_functions_backend_dbHandler__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(1273);
|
||
|
/* harmony import */ var _package_shared_functions_backend_dbHandler__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_package_shared_functions_backend_dbHandler__WEBPACK_IMPORTED_MODULE_6__);
|
||
|
// @ts-check
|
||
|
/**
|
||
|
* Imports
|
||
|
* ==============================================================================
|
||
|
*/
|
||
|
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
|
||
|
* ==============================================================================
|
||
|
* Main Component { Functional }
|
||
|
* ==============================================================================
|
||
|
* @param {Object} props - Server props
|
||
|
* @param {any[]} props.pages
|
||
|
* @param {any} props.targetPage
|
||
|
*/ function Homepage({ pages , targetPage }) {
|
||
|
/**
|
||
|
* Get Contexts
|
||
|
*
|
||
|
* @abstract { React.useContext }
|
||
|
*/ if (true) {
|
||
|
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(()=>{
|
||
|
window.location.href = "https://datasquirel.com/docs/getting-started";
|
||
|
}, []);
|
||
|
return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx((react__WEBPACK_IMPORTED_MODULE_1___default().Fragment), {});
|
||
|
}
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
/**
|
||
|
* Javascript Variables
|
||
|
*
|
||
|
* @abstract Non hook variables and functions
|
||
|
*/ const pageTitle = `${targetPage.title} | Datasquirel docs`;
|
||
|
const pageDescription = targetPage.description;
|
||
|
let head = /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)(react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.Fragment, {
|
||
|
children: [
|
||
|
/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("title", {
|
||
|
children: pageTitle
|
||
|
}),
|
||
|
/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("meta", {
|
||
|
name: "description",
|
||
|
content: pageDescription
|
||
|
}),
|
||
|
/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_general_PageHeadTags__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, {
|
||
|
pageTitle: pageTitle,
|
||
|
pageDescription: pageDescription,
|
||
|
pagePathname: "/"
|
||
|
})
|
||
|
]
|
||
|
});
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
/**
|
||
|
* React Hooks
|
||
|
*
|
||
|
* @abstract { useState, useEffect, useRef, etc ... }
|
||
|
*/ const [user, setUser] = react__WEBPACK_IMPORTED_MODULE_1___default().useState(null);
|
||
|
react__WEBPACK_IMPORTED_MODULE_1___default().useEffect(()=>{
|
||
|
(0,_functions_frontend_clientAuthUser__WEBPACK_IMPORTED_MODULE_7__/* ["default"] */ .Z)({
|
||
|
setUser
|
||
|
});
|
||
|
}, []);
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
/**
|
||
|
* Function Return
|
||
|
*
|
||
|
* @abstract Main Function Return
|
||
|
*/ return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_layouts_GeneralLayout__WEBPACK_IMPORTED_MODULE_2__/* ["default"] */ .Z, {
|
||
|
head: head,
|
||
|
user: user,
|
||
|
children: /*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("div", {
|
||
|
className: "items-stretch w-full gap-0 flex-col-reverse lg:flex-row",
|
||
|
children: [
|
||
|
/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_pages_docs_DocsAside__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, {
|
||
|
pages: pages
|
||
|
}),
|
||
|
/*#__PURE__*/ (0,react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsxs)("main", {
|
||
|
children: [
|
||
|
/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_pages_docs_DocsGenereicHero__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .Z, {
|
||
|
title: targetPage.title,
|
||
|
description: targetPage.description
|
||
|
}),
|
||
|
/*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx("div", {
|
||
|
className: "RTE-DOCS pl-4 sm:pl-10 pt-4 pb-20 pr-4",
|
||
|
dangerouslySetInnerHTML: {
|
||
|
__html: targetPage.content
|
||
|
}
|
||
|
})
|
||
|
]
|
||
|
})
|
||
|
]
|
||
|
})
|
||
|
});
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
}
|
||
|
/** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /**
|
||
|
* Server Side Props or Static Props
|
||
|
* @type {import("next").GetStaticProps}
|
||
|
*/ async function getStaticProps({ params }) {
|
||
|
/**
|
||
|
* User Auth
|
||
|
*
|
||
|
* @description User Auth
|
||
|
*/ const pages = await _package_shared_functions_backend_dbHandler__WEBPACK_IMPORTED_MODULE_6___default()(`SELECT id, title, slug, level, parent_id FROM docs_pages ORDER BY page_order ASC`);
|
||
|
/** @type {any[]} */ // @ts-ignore
|
||
|
const targetPage = await _package_shared_functions_backend_dbHandler__WEBPACK_IMPORTED_MODULE_6___default()(`SELECT title, slug, description, content FROM docs_pages WHERE slug = ?`, [
|
||
|
params?.page
|
||
|
]);
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
/**
|
||
|
* Server props return
|
||
|
*
|
||
|
* @description Return data fetched on the server side
|
||
|
*/ return {
|
||
|
props: {
|
||
|
user: null,
|
||
|
pages,
|
||
|
targetPage: targetPage[0] ? targetPage[0] : {}
|
||
|
}
|
||
|
};
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
////////////////////////////////////////
|
||
|
}
|
||
|
/**
|
||
|
*
|
||
|
* Static Props
|
||
|
* @type {import("next").GetStaticPaths}
|
||
|
*/ async function getStaticPaths() {
|
||
|
try {
|
||
|
/**
|
||
|
* Page/Site Data Data Fetching
|
||
|
*
|
||
|
* @description Fetch data on the server before returning
|
||
|
*/ /** @type {any[]} */ // @ts-ignore
|
||
|
const entries = await _package_shared_functions_backend_dbHandler__WEBPACK_IMPORTED_MODULE_6___default()(`SELECT id, title, slug, level, parent_id FROM docs_pages WHERE level = 1`);
|
||
|
const paths = entries.map((entry)=>{
|
||
|
return {
|
||
|
params: {
|
||
|
page: entry.slug
|
||
|
}
|
||
|
};
|
||
|
});
|
||
|
/**
|
||
|
* Server props return
|
||
|
*
|
||
|
* @description Return data fetched on the server side
|
||
|
*/ return {
|
||
|
paths: paths,
|
||
|
fallback: false
|
||
|
};
|
||
|
} catch (/** @type {any} */ error) {
|
||
|
/**
|
||
|
* Error Response
|
||
|
*
|
||
|
* @description Return data fetched on the server side
|
||
|
*/ console.log("Error =>", error.message);
|
||
|
return {
|
||
|
paths: [],
|
||
|
fallback: false
|
||
|
};
|
||
|
}
|
||
|
}
|
||
|
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 386:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("@mui/icons-material/CottageTwoTone");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 5557:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("@mui/icons-material/MenuBookTwoTone");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 2423:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("lucide-react");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 968:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("next/head");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 6689:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("react");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 997:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("react/jsx-runtime");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 2261:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("serverless-mysql");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 7147:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("fs");
|
||
|
|
||
|
/***/ }),
|
||
|
|
||
|
/***/ 1017:
|
||
|
/***/ ((module) => {
|
||
|
|
||
|
module.exports = require("path");
|
||
|
|
||
|
/***/ })
|
||
|
|
||
|
};
|
||
|
;
|
||
|
|
||
|
// load runtime
|
||
|
var __webpack_require__ = require("../../webpack-runtime.js");
|
||
|
__webpack_require__.C(exports);
|
||
|
var __webpack_exec__ = (moduleId) => (__webpack_require__(__webpack_require__.s = moduleId))
|
||
|
var __webpack_exports__ = __webpack_require__.X(0, [4017,8313,5264,6729,5449,913,9360,6217,4097,7023,9922,6000,2896], () => (__webpack_exec__(203)));
|
||
|
module.exports = __webpack_exports__;
|
||
|
|
||
|
})();
|