"use strict"; (() => { var exports = {}; exports.id = 3663; exports.ids = [3663]; exports.modules = { /***/ 9011: /***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { __webpack_require__.r(__webpack_exports__); /* harmony export */ __webpack_require__.d(__webpack_exports__, { /* harmony export */ "default": () => (/* binding */ Dashboard), /* harmony export */ "getServerSideProps": () => (/* binding */ getServerSideProps) /* 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 _functions_backend_suAdminUserAuth__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(1503); /* harmony import */ var _functions_backend_suAdminUserAuth__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_functions_backend_suAdminUserAuth__WEBPACK_IMPORTED_MODULE_2__); /* harmony import */ var _layouts_SuAdminLayout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(8282); /* harmony import */ var _components_su_SuDashboardContent__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(4187); /* harmony import */ var _package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(9395); /* harmony import */ var _package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_5__); // @ts-check /** * ============================================================================== * Imports * ============================================================================== */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** * ============================================================================== * Main Component { Functional } * ============================================================================== * @param {Object} props - Server props * @param {import("@/package-shared/types").UserType} props.user * @param {any} props.data */ function Dashboard({ user , data }) { /** * Get Contexts * * @abstract { React.useContext } */ //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// /** * Javascript Variables * * @abstract Non hook variables and functions */ const pageTitle = "User Dashboard | Datasquirel"; const pageDescription = "Welcome to your data app"; 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 }) ] }); //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// /** * React Hooks * * @abstract { useState, useEffect, useRef, etc ... } */ //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// /** * Function Return * * @abstract Main Function Return */ return /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_layouts_SuAdminLayout__WEBPACK_IMPORTED_MODULE_3__/* ["default"] */ .Z, { head: head, user: user, children: /*#__PURE__*/ react_jsx_runtime__WEBPACK_IMPORTED_MODULE_0__.jsx(_components_su_SuDashboardContent__WEBPACK_IMPORTED_MODULE_4__/* ["default"] */ .Z, { data: data }) }); //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// } /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** ****************************************************************************** */ /** * ============================================================================== * Server Side Props or Static Props * ============================================================================== * @type {import("next").GetServerSideProps} */ async function getServerSideProps({ req , res , query }) { /** * User Auth * * @description User Auth */ const suAdminUser = await _functions_backend_suAdminUserAuth__WEBPACK_IMPORTED_MODULE_2___default()(req); if (!suAdminUser?.logged_in_status) { return { redirect: { destination: `/su/login`, permanent: false } }; } /** * Page/Site Data Data Fetching * * @description Fetch data on the server before returning */ const users = await _package_shared_utils_backend_global_db_DB_HANDLER__WEBPACK_IMPORTED_MODULE_5___default()(`SELECT * FROM users ORDER BY id DESC`); //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// /** * Server props return * * @description Return data fetched on the server side */ return { props: { user: suAdminUser, data: { users } } }; //////////////////////////////////////// //////////////////////////////////////// //////////////////////////////////////// } /***/ }), /***/ 9318: /***/ ((module) => { module.exports = require("@mui/icons-material/BackupTwoTone"); /***/ }), /***/ 386: /***/ ((module) => { module.exports = require("@mui/icons-material/CottageTwoTone"); /***/ }), /***/ 6817: /***/ ((module) => { module.exports = require("@mui/icons-material/DocumentScannerTwoTone"); /***/ }), /***/ 6094: /***/ ((module) => { module.exports = require("@mui/icons-material/ErrorTwoTone"); /***/ }), /***/ 6547: /***/ ((module) => { module.exports = require("@mui/icons-material/LockPersonTwoTone"); /***/ }), /***/ 5557: /***/ ((module) => { module.exports = require("@mui/icons-material/MenuBookTwoTone"); /***/ }), /***/ 8245: /***/ ((module) => { module.exports = require("@mui/icons-material/PeopleAltTwoTone"); /***/ }), /***/ 415: /***/ ((module) => { module.exports = require("@mui/icons-material/TerminalTwoTone"); /***/ }), /***/ 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"); /***/ }), /***/ 4300: /***/ ((module) => { module.exports = require("buffer"); /***/ }), /***/ 6113: /***/ ((module) => { module.exports = require("crypto"); /***/ }), /***/ 7147: /***/ ((module) => { module.exports = require("fs"); /***/ }), /***/ 3685: /***/ ((module) => { module.exports = require("http"); /***/ }), /***/ 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,4480,1503,5313,1336,4187], () => (__webpack_exec__(9011))); module.exports = __webpack_exports__; })();