Commit 85e063a9 authored by Grant's avatar Grant
Browse files

Update Admin/Mod UI

parent 536ac012
Loading
Loading
Loading
Loading
Loading
+45 −6
Original line number Diff line number Diff line
import eslint from "@eslint/js";
import { defineConfig, globalIgnores } from "eslint/config";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import simpleImportSort from "eslint-plugin-simple-import-sort";
import globals from "globals";
import tseslint from "typescript-eslint";

export default defineConfig(
  globalIgnores([
    "**/node_modules",
    "packages/**/dist",
    "packages/admin",
    "packages/chat",
  ]),
  globalIgnores(["**/node_modules", "packages/**/dist", "packages/chat/**"]),

  // -- global config --
  eslint.configs.recommended,
@@ -62,6 +60,47 @@ export default defineConfig(
    },
  },

  // -- admin --
  {
    files: ["packages/admin/src/**/*.{ts,tsx,js,jsx}"],
    plugins: {
      react,
      "react-hooks": reactHooks,
      "react-refresh": reactRefresh,
    },
    settings: {
      react: {
        version: "detect",
      },
    },
    languageOptions: {
      globals: {
        ...globals.browser,
      },
    },
    rules: {
      "no-unused-vars": "off",
      "@typescript-eslint/no-explicit-any": "off",

      "@typescript-eslint/no-unused-vars": [
        "error",
        {
          argsIgnorePattern: "^_",
          caughtErrors: "all",
          caughtErrorsIgnorePattern: "^_",
          destructuredArrayIgnorePattern: "^_",
          varsIgnorePattern: "^_",
          ignoreRestSiblings: true,
        },
      ],

      "react-refresh/only-export-components": [
        "warn",
        { allowConstantExport: true },
      ],
    },
  },

  // -- server --
  {
    files: ["packages/server/src/**/*.{ts,js}"],

packages/admin/.eslintrc.cjs

deleted100644 → 0
+0 −18
Original line number Diff line number Diff line
module.exports = {
  root: true,
  env: { browser: true, es2020: true },
  extends: [
    'eslint:recommended',
    'plugin:@typescript-eslint/recommended',
    'plugin:react-hooks/recommended',
  ],
  ignorePatterns: ['dist', '.eslintrc.cjs'],
  parser: '@typescript-eslint/parser',
  plugins: ['react-refresh'],
  rules: {
    'react-refresh/only-export-components': [
      'warn',
      { allowConstantExport: true },
    ],
  },
}
+5 −4
Original line number Diff line number Diff line
@@ -6,13 +6,14 @@
  "scripts": {
    "dev": "vite",
    "build": "tsc && vite build",
    "lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
    "lint": "eslint --config ../../eslint.config.mjs 'src/**/*.{ts,tsx}' --max-warnings 0",
    "preview": "vite preview"
  },
  "dependencies": {
    "@nextui-org/react": "^2.6.11",
    "apexcharts": "^5.16.0",
    "framer-motion": "^12.42.2",
    "@heroui/react": "^3.2.2",
    "@heroui/styles": "^3.2.2",
    "apexcharts": "^5.5.0",
    "framer-motion": "^12.34.0",
    "localforage": "^1.10.0",
    "lucide-react": "^1.24.0",
    "match-sorter": "^8.3.0",

packages/admin/src/App.css

deleted100644 → 0
+0 −0

Empty file deleted.

packages/admin/src/App.tsx

deleted100644 → 0
+0 −101
Original line number Diff line number Diff line
import { Card, CardBody, Link } from "@nextui-org/react";
import "./App.css";
import { ChartTest } from "./components/ChartTest";
import { CardAgents } from "./components/CardAgents";
import { CardTransactions } from "./components/CardTransactions";
import { TableWrapper } from "./components/table/TableWrapper";

const CardTest = () => {
  return (
    <Card className="xl:max-w-sm bg-primary rounded-xl shadow-md px-3 w-full">
      <CardBody className="py-5">
        <div className="flex gap-2.5">
          {/* <Community /> */}
          <div className="flex flex-col">
            <span className="text-white">Auto Insurance</span>
            <span className="text-white text-xs">1311 Cars</span>
          </div>
        </div>
        <div className="flex gap-2.5 py-2 items-center">
          <span className="text-white text-xl font-semibold">$45,910</span>
          <span className="text-success text-xs">+ 4.5%</span>
        </div>
        <div className="flex items-center gap-6">
          <div>
            <div>
              <span className="font-semibold text-success text-xs">{""}</span>
              <span className="text-xs text-white">100,930</span>
            </div>
            <span className="text-white text-xs">USD</span>
          </div>

          <div>
            <div>
              <span className="font-semibold text-danger text-xs">{""}</span>
              <span className="text-xs text-white">54,120</span>
            </div>
            <span className="text-white text-xs">USD</span>
          </div>

          <div>
            <div>
              <span className="font-semibold text-danger text-xs">{""}</span>
              <span className="text-xs text-white">125</span>
            </div>
            <span className="text-white text-xs">VIP</span>
          </div>
        </div>
      </CardBody>
    </Card>
  );
};

function App() {
  return (
    <div className="h-full lg:px-6">
      <div className="flex justify-center gap-4 xl:gap-6 pt-3 px-4 lg:px-0  flex-wrap xl:flex-nowrap sm:pt-10 max-w-[90rem] mx-auto w-full">
        <div className="mt-6 gap-6 flex flex-col w-full">
          {/* Card Section Top */}
          <div className="flex flex-col gap-2">
            <h3 className="text-xl font-semibold">Available Balance</h3>
            <div className="grid md:grid-cols-2 grid-cols-1 2xl:grid-cols-3 gap-5  justify-center w-full">
              <CardTest />
              <CardTest />
              <CardTest />
            </div>
          </div>

          {/* Chart */}
          <div className="h-full flex flex-col gap-2">
            <h3 className="text-xl font-semibold">Statistics</h3>
            <div className="w-full bg-default-50 shadow-lg rounded-2xl p-6 ">
              <ChartTest />
            </div>
          </div>
        </div>

        {/* Left Section */}
        <div className="mt-4 gap-2 flex flex-col xl:max-w-md w-full">
          <h3 className="text-xl font-semibold">Section</h3>
          <div className="flex flex-col justify-center gap-4 flex-wrap md:flex-nowrap md:flex-col">
            <CardAgents />
            <CardTransactions />
          </div>
        </div>
      </div>

      {/* Table Latest Users */}
      <div className="flex flex-col justify-center w-full py-5 px-4 lg:px-0  max-w-[90rem] mx-auto gap-3">
        <div className="flex  flex-wrap justify-between">
          <h3 className="text-center text-xl font-semibold">Latest Users</h3>
          <Link href="/accounts" color="primary" className="cursor-pointer">
            View All
          </Link>
        </div>
        <TableWrapper />
      </div>
    </div>
  );
}

export default App;
Loading