From 6903a8deb0259c56ea1de11a4ab5cc34ed9b7998 Mon Sep 17 00:00:00 2001 From: Thastertyn Date: Tue, 22 Apr 2025 00:16:08 +0200 Subject: [PATCH] Final commit (most likely) --- backend/Dockerfile | 48 +- docker-compose.yml | 97 +- frontend/.dockerignore | 2 + frontend/.env.example | 3 +- frontend/Dockerfile | 14 + .../src/api/mock/data/create-purchase-data.ts | 63 + frontend/src/api/mock/db.ts | 2 +- frontend/src/api/mock/models.ts | 2 +- frontend/src/api/mock/products-mock-api.ts | 5 - frontend/src/api/mock/purchase-mock-api.ts | 30 +- frontend/src/components/currency-input.tsx | 2 +- .../src/components/layout/app-sidebar.tsx | 13 - .../components/layout/data/sidebar-data.ts | 66 +- frontend/src/components/layout/nav-user.tsx | 114 -- frontend/src/components/main-navbar.tsx | 8 +- frontend/src/components/profile-dropdown.tsx | 6 - frontend/src/components/ui/calendar.tsx | 68 - frontend/src/hooks/usePurchase.ts | 41 +- frontend/src/pages/home/index.tsx | 4 +- .../products/components/product-form.tsx | 4 +- .../coupons/components/coupon-columns.tsx | 1 + .../coupons/components/data-table-toolbar.tsx | 4 +- frontend/src/pages/sales/coupons/index.tsx | 2 - .../components/data-table-column-header.tsx | 0 .../components/data-table-faceted-filter.tsx | 7 +- .../components/data-table-pagination.tsx | 0 .../components/data-table-row-actions.tsx | 45 + .../components/data-table-toolbar.tsx | 23 +- .../components/data-table-view-options.tsx | 0 .../components/purchase-action-dialog.tsx | 219 +++ .../components/purchase-columns.tsx | 95 ++ .../components/purchase-delete-dialog.tsx | 65 + .../components/purchase-dialog.tsx | 45 + .../components/purchase-primary-buttons.tsx | 14 + .../components/purchase-table.tsx} | 73 +- .../recent-sales/context/purchase-context.tsx | 42 + .../src/pages/sales/recent-sales/data/data.ts | 25 + .../pages/sales/recent-sales/data/schema.ts | 13 + .../src/pages/sales/recent-sales/index.tsx | 75 + .../pages/settings/account/account-form.tsx | 135 -- frontend/src/pages/settings/account/index.tsx | 14 - .../pages/settings/display/display-form.tsx | 129 -- frontend/src/pages/settings/display/index.tsx | 13 - frontend/src/pages/settings/index.tsx | 24 +- .../pages/settings/notifications/index.tsx | 13 - .../notifications/notifications-form.tsx | 225 --- .../src/pages/settings/security/index.tsx | 10 - .../pages/settings/security/security-form.tsx | 116 -- .../pages/shop/components/shop-sidebar.tsx | 1 + frontend/src/pages/shop/index.tsx | 4 +- .../src/pages/tasks/components/columns.tsx | 119 -- .../components/data-table-row-actions.tsx | 83 - .../pages/tasks/components/tasks-dialogs.tsx | 78 - .../tasks/components/tasks-import-dialog.tsx | 116 -- .../tasks/components/tasks-mutate-drawer.tsx | 215 --- .../components/tasks-primary-buttons.tsx | 21 - .../src/pages/tasks/context/tasks-context.tsx | 39 - frontend/src/pages/tasks/data/data.tsx | 71 - frontend/src/pages/tasks/data/schema.ts | 13 - frontend/src/pages/tasks/data/tasks.ts | 782 ---------- frontend/src/pages/tasks/index.tsx | 42 - .../users/components/data-table-toolbar.tsx | 12 - .../components/users-primary-buttons.tsx | 9 +- frontend/src/routeTree.gen.ts | 1380 ++++++++--------- frontend/src/routes/(auth)/sign-in.tsx | 2 +- .../dashboard/mock/index.lazy.tsx | 11 + .../dashboard/sales/recent-sales.lazy.tsx | 6 +- .../dashboard/settings/account.lazy.tsx | 8 - .../dashboard/settings/display.lazy.tsx | 8 - .../dashboard/settings/notifications.lazy.tsx | 8 - .../dashboard/settings/security.lazy.tsx | 8 - .../dashboard/tasks/index.lazy.tsx | 6 - frontend/src/utils/token-validation.ts | 24 +- 73 files changed, 1593 insertions(+), 3492 deletions(-) create mode 100644 frontend/.dockerignore create mode 100644 frontend/Dockerfile create mode 100644 frontend/src/api/mock/data/create-purchase-data.ts delete mode 100644 frontend/src/components/layout/nav-user.tsx delete mode 100644 frontend/src/components/ui/calendar.tsx rename frontend/src/pages/{tasks => sales/recent-sales}/components/data-table-column-header.tsx (100%) rename frontend/src/pages/{tasks => sales/recent-sales}/components/data-table-faceted-filter.tsx (94%) rename frontend/src/pages/{tasks => sales/recent-sales}/components/data-table-pagination.tsx (100%) create mode 100644 frontend/src/pages/sales/recent-sales/components/data-table-row-actions.tsx rename frontend/src/pages/{tasks => sales/recent-sales}/components/data-table-toolbar.tsx (66%) rename frontend/src/pages/{tasks => sales/recent-sales}/components/data-table-view-options.tsx (100%) create mode 100644 frontend/src/pages/sales/recent-sales/components/purchase-action-dialog.tsx create mode 100644 frontend/src/pages/sales/recent-sales/components/purchase-columns.tsx create mode 100644 frontend/src/pages/sales/recent-sales/components/purchase-delete-dialog.tsx create mode 100644 frontend/src/pages/sales/recent-sales/components/purchase-dialog.tsx create mode 100644 frontend/src/pages/sales/recent-sales/components/purchase-primary-buttons.tsx rename frontend/src/pages/{tasks/components/data-table.tsx => sales/recent-sales/components/purchase-table.tsx} (56%) create mode 100644 frontend/src/pages/sales/recent-sales/context/purchase-context.tsx create mode 100644 frontend/src/pages/sales/recent-sales/data/data.ts create mode 100644 frontend/src/pages/sales/recent-sales/data/schema.ts create mode 100644 frontend/src/pages/sales/recent-sales/index.tsx delete mode 100644 frontend/src/pages/settings/account/account-form.tsx delete mode 100644 frontend/src/pages/settings/account/index.tsx delete mode 100644 frontend/src/pages/settings/display/display-form.tsx delete mode 100644 frontend/src/pages/settings/display/index.tsx delete mode 100644 frontend/src/pages/settings/notifications/index.tsx delete mode 100644 frontend/src/pages/settings/notifications/notifications-form.tsx delete mode 100644 frontend/src/pages/settings/security/index.tsx delete mode 100644 frontend/src/pages/settings/security/security-form.tsx delete mode 100644 frontend/src/pages/tasks/components/columns.tsx delete mode 100644 frontend/src/pages/tasks/components/data-table-row-actions.tsx delete mode 100644 frontend/src/pages/tasks/components/tasks-dialogs.tsx delete mode 100644 frontend/src/pages/tasks/components/tasks-import-dialog.tsx delete mode 100644 frontend/src/pages/tasks/components/tasks-mutate-drawer.tsx delete mode 100644 frontend/src/pages/tasks/components/tasks-primary-buttons.tsx delete mode 100644 frontend/src/pages/tasks/context/tasks-context.tsx delete mode 100644 frontend/src/pages/tasks/data/data.tsx delete mode 100644 frontend/src/pages/tasks/data/schema.ts delete mode 100644 frontend/src/pages/tasks/data/tasks.ts delete mode 100644 frontend/src/pages/tasks/index.tsx create mode 100644 frontend/src/routes/_authenticated/dashboard/mock/index.lazy.tsx delete mode 100644 frontend/src/routes/_authenticated/dashboard/settings/account.lazy.tsx delete mode 100644 frontend/src/routes/_authenticated/dashboard/settings/display.lazy.tsx delete mode 100644 frontend/src/routes/_authenticated/dashboard/settings/notifications.lazy.tsx delete mode 100644 frontend/src/routes/_authenticated/dashboard/settings/security.lazy.tsx delete mode 100644 frontend/src/routes/_authenticated/dashboard/tasks/index.lazy.tsx diff --git a/backend/Dockerfile b/backend/Dockerfile index 46f65b9..b564919 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,25 +1,41 @@ -# Base Image -FROM python:3.13 +FROM python:3.12 -RUN pip install poetry - -# Environment variables ENV PYTHONUNBUFFERED=1 -# Set working directory WORKDIR /app/ -# Copy dependency files first to leverage caching -COPY pyproject.toml poetry.lock /app/ +# Install uv +# Ref: https://docs.astral.sh/uv/guides/integration/docker/#installing-uv +COPY --from=ghcr.io/astral-sh/uv:0.5.11 /uv /uvx /bin/ + +# Place executables in the environment at the front of the path +# Ref: https://docs.astral.sh/uv/guides/integration/docker/#using-the-environment +ENV PATH="/app/.venv/bin:$PATH" + +# Compile bytecode +# Ref: https://docs.astral.sh/uv/guides/integration/docker/#compiling-bytecode +ENV UV_COMPILE_BYTECODE=1 + +# uv Cache +# Ref: https://docs.astral.sh/uv/guides/integration/docker/#caching +ENV UV_LINK_MODE=copy + +# Install dependencies +# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers +RUN --mount=type=cache,target=/root/.cache/uv \ + --mount=type=bind,source=uv.lock,target=uv.lock \ + --mount=type=bind,source=pyproject.toml,target=pyproject.toml \ + uv sync --frozen --no-install-project + +ENV PYTHONPATH=/app + +COPY ./pyproject.toml ./uv.lock /app/ -# Copy the rest of the application COPY ./app /app/app -# Ensure dependencies are installed correctly -RUN poetry install --no-interaction --no-ansi --without dev +# Sync the project +# Ref: https://docs.astral.sh/uv/guides/integration/docker/#intermediate-layers +RUN --mount=type=cache,target=/root/.cache/uv \ + uv sync -# Expose port for FastAPI -EXPOSE 8000 - -# Command to run the app -CMD ["poetry", "run", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000", "--workers", "4"] +CMD ["fastapi", "run", "--workers", "4", "app/main.py"] \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index d50c655..0c325ec 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,68 +1,55 @@ +version: "3.9" services: + backend: + build: + context: ./backend + container_name: swagshop-backend + depends_on: + db: + condition: service_healthy + env_file: + - ./.env + networks: + - internal + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:8000/utils/health-check/"] + interval: 10s + timeout: 5s + retries: 5 + ports: + - "8000:8000" + + frontend: + build: + context: ./frontend/ + container_name: swagshop-frontend + env_file: + - ./frontend/.env + ports: + - "5173:5173" db: - image: postgres:12 - restart: no + image: postgres:16 + container_name: swagshop-postgres + restart: unless-stopped healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 10s retries: 5 start_period: 30s timeout: 10s + environment: + POSTGRES_USER: postgres + POSTGRES_PASSWORD: postgres + POSTGRES_DB: swagshop volumes: - - app-db-data:/var/lib/postgresql/data/pgdata - env_file: - - .env - environment: - - PGDATA=/var/lib/postgresql/data/pgdata - - POSTGRES_PASSWORD=${POSTGRES_PASSWORD?Variable not set} - - POSTGRES_USER=${POSTGRES_USER?Variable not set} - - POSTGRES_DB=${POSTGRES_DB?Variable not set} - - adminer: - image: adminer - restart: no + - pgdata:/var/lib/postgresql/data networks: - - default - depends_on: - - db - environment: - - ADMINER_DESIGN=pepa-linha-dark - - backend: - image: '${DOCKER_IMAGE_BACKEND?Variable not set}:${TAG-latest}' - restart: no - networks: - - default - depends_on: - db: - condition: service_healthy - env_file: - - .env - environment: - - FRONTEND_HOST=${FRONTEND_HOST?Variable not set} - - ENVIRONMENT=${ENVIRONMENT} - - BACKEND_CORS_ORIGINS=${BACKEND_CORS_ORIGINS} - - SECRET_KEY=${SECRET_KEY?Variable not set} - - FIRST_SUPERUSER=${FIRST_SUPERUSER?Variable not set} - - FIRST_SUPERUSER_PASSWORD=${FIRST_SUPERUSER_PASSWORD?Variable not set} - - SMTP_HOST=${SMTP_HOST} - - SMTP_USER=${SMTP_USER} - - SMTP_PASSWORD=${SMTP_PASSWORD} - - EMAILS_FROM_EMAIL=${EMAILS_FROM_EMAIL} - - MYSQL_SERVER=db - - MYSQL_PORT=${MYSQL_PORT} - - MYSQL_DB=${MYSQL_DB} - - MYSQL_USER=${MYSQL_USER?Variable not set} - - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:8000/utils/health-check/"] - interval: 10s - timeout: 5s - retries: 5 - - build: - context: ./backend + - internal volumes: - app-db-data: + pgdata: + +networks: + internal: + driver: bridge diff --git a/frontend/.dockerignore b/frontend/.dockerignore new file mode 100644 index 0000000..04c01ba --- /dev/null +++ b/frontend/.dockerignore @@ -0,0 +1,2 @@ +node_modules/ +dist/ \ No newline at end of file diff --git a/frontend/.env.example b/frontend/.env.example index 3452b5c..66bcabb 100644 --- a/frontend/.env.example +++ b/frontend/.env.example @@ -1 +1,2 @@ -VITE_API_URL= \ No newline at end of file +VITE_API_URL=http://localhost:8000 +VITE_USE_MOCK_API=true \ No newline at end of file diff --git a/frontend/Dockerfile b/frontend/Dockerfile new file mode 100644 index 0000000..052b080 --- /dev/null +++ b/frontend/Dockerfile @@ -0,0 +1,14 @@ +FROM node:20 + +WORKDIR /app + +COPY package.json ./ +RUN npm install + +COPY . . + +RUN npm run build && npm install -g serve + +EXPOSE 5173 + +CMD ["serve", "-s", "dist", "-l", "5173"] diff --git a/frontend/src/api/mock/data/create-purchase-data.ts b/frontend/src/api/mock/data/create-purchase-data.ts new file mode 100644 index 0000000..b7fbc52 --- /dev/null +++ b/frontend/src/api/mock/data/create-purchase-data.ts @@ -0,0 +1,63 @@ +import { MockPurchaseAPI } from "../purchase-mock-api"; +import { mockDB } from "../db"; + +export async function createSamplePurchase() { + const users = await mockDB.users.where("user_role").equals("customer").toArray(); + if (users.length === 0) throw new Error("No customers found"); + + const user = users[Math.floor(Math.random() * users.length)]; + const products = await mockDB.products.toArray(); + if (products.length === 0) throw new Error("No products found"); + + const entries = []; + + for (let i = 0; i < Math.floor(Math.random() * 3) + 1; i++) { + const product = products[Math.floor(Math.random() * products.length)]; + + const quantity = Math.floor(Math.random() * 4) + 1; + + entries.push({ + purchase_id: 0, + product_id: product.id, + product_variant_id: 0, + quantity, + }); + } + + if (entries.length === 0) throw new Error("No suitable product variants found"); + + const total = await entries.reduce(async (accP, entry) => { + const acc = await accP; + const product = await mockDB.products.get(entry.product_id); + return acc + ((product?.price ?? 0) * entry.quantity); + }, Promise.resolve(0)); + + // Randomly apply a valid coupon + const coupons = await mockDB.coupons.toArray(); + const validCoupons = coupons.filter( + (c) => new Date(c.valid_due) > new Date() + ); + const useCoupon = validCoupons.length > 0 && Math.random() < 0.5; + const chosenCoupon = useCoupon + ? validCoupons[Math.floor(Math.random() * validCoupons.length)] + : null; + + const discountedTotal = chosenCoupon + ? Math.max(0, total - chosenCoupon.discount_amount) + : total; + + const purchase = await MockPurchaseAPI.createPurchase( + { + user_id: user.id, + used_coupon_id: chosenCoupon?.id ?? null, + date_purchased: new Date().toISOString(), + total: discountedTotal, + }, + entries, + ); + + console.log( + `Created mock purchase${chosenCoupon ? " with coupon" : ""}:`, + purchase, + ); +} diff --git a/frontend/src/api/mock/db.ts b/frontend/src/api/mock/db.ts index 2d83939..795d31f 100644 --- a/frontend/src/api/mock/db.ts +++ b/frontend/src/api/mock/db.ts @@ -31,7 +31,7 @@ class MockDB extends Dexie { constructor() { super("MockDB"); this.version(1).stores({ - users: "++id,username,email,uuid", + users: "++id,username,email,uuid,user_role", preferences: "user_id", statistics: "user_id", shops: "++id,uuid,name", diff --git a/frontend/src/api/mock/models.ts b/frontend/src/api/mock/models.ts index 4351033..484ade2 100644 --- a/frontend/src/api/mock/models.ts +++ b/frontend/src/api/mock/models.ts @@ -86,7 +86,7 @@ export interface ProductCreate { description: string; price: number; stock_quantity: number; - image_data: string | undefined; + image_data?: string | undefined; } export interface ProductWithDetails extends Product { diff --git a/frontend/src/api/mock/products-mock-api.ts b/frontend/src/api/mock/products-mock-api.ts index 0de9dd8..38c77b7 100644 --- a/frontend/src/api/mock/products-mock-api.ts +++ b/frontend/src/api/mock/products-mock-api.ts @@ -55,10 +55,6 @@ export const MockProductAPI = { .where("product_id") .equals(productId) .toArray(); - const variants = await mockDB.product_variants - .where("product_id") - .equals(productId) - .toArray(); const categoryLinks = await mockDB.product_category_junctions .where("product_id") .equals(productId) @@ -76,7 +72,6 @@ export const MockProductAPI = { return { ...product, images, - variants, categories, }; }, diff --git a/frontend/src/api/mock/purchase-mock-api.ts b/frontend/src/api/mock/purchase-mock-api.ts index 604e2a5..78207c4 100644 --- a/frontend/src/api/mock/purchase-mock-api.ts +++ b/frontend/src/api/mock/purchase-mock-api.ts @@ -53,7 +53,7 @@ export const MockPurchaseAPI = { async createPurchase( purchase: Omit, - entries: Omit[], + entries: Omit[] = [], ): Promise { const id = Date.now(); const newPurchase: Purchase = { @@ -63,17 +63,31 @@ export const MockPurchaseAPI = { await mockDB.purchases.add(newPurchase); - await mockDB.purchase_entries.bulkAdd( - entries.map((entry) => ({ - ...entry, - purchase_id: id, - id: Date.now() + Math.random(), - })), - ); + if (entries.length > 0) { + await mockDB.purchase_entries.bulkAdd( + entries.map((entry) => ({ + ...entry, + purchase_id: id, + id: Date.now() + Math.random(), + })), + ); + } return newPurchase; }, + async updatePurchase( + purchaseId: number, + updates: Partial>, + ): Promise { + const existing = await mockDB.purchases.get(purchaseId); + if (!existing) return null; + + const updated = { ...existing, ...updates }; + await mockDB.purchases.put(updated); + return updated; + }, + async deletePurchase(purchaseId: number): Promise { await mockDB.purchase_entries .where("purchase_id") diff --git a/frontend/src/components/currency-input.tsx b/frontend/src/components/currency-input.tsx index a30e12e..8ea73c6 100644 --- a/frontend/src/components/currency-input.tsx +++ b/frontend/src/components/currency-input.tsx @@ -1,4 +1,4 @@ -const currencies = [ +export const currencies = [ "AED", "AFN", "ALL", diff --git a/frontend/src/components/layout/app-sidebar.tsx b/frontend/src/components/layout/app-sidebar.tsx index 114b83d..baf9e9f 100644 --- a/frontend/src/components/layout/app-sidebar.tsx +++ b/frontend/src/components/layout/app-sidebar.tsx @@ -1,27 +1,14 @@ import { Sidebar, SidebarContent, - SidebarHeader, SidebarRail, } from "@/components/ui/sidebar"; import { NavGroup } from "@/components/layout/nav-group"; import { sidebarData } from "./data/sidebar-data"; -import { cn } from "@/lib/utils"; -import { IconCoin } from "@tabler/icons-react"; export function AppSidebar({ ...props }: React.ComponentProps) { return ( - -

- -

-
{sidebarData.navGroups.map((props) => ( diff --git a/frontend/src/components/layout/data/sidebar-data.ts b/frontend/src/components/layout/data/sidebar-data.ts index 6c5097e..04e37ff 100644 --- a/frontend/src/components/layout/data/sidebar-data.ts +++ b/frontend/src/components/layout/data/sidebar-data.ts @@ -1,20 +1,14 @@ -import { - IconBrowserCheck, - IconBuildingStore, - IconClipboardCheckFilled, - IconCoin, - IconForklift, - IconHelp, - IconLayoutDashboard, - IconNotification, - IconPackage, - IconPalette, - IconSettings, - IconTag, - IconTool, - IconUserCog, - IconUsers, -} from "@tabler/icons-react"; +import + { + IconBuildingStore, + IconClipboardCheckFilled, + IconCoin, IconPackage, + IconPalette, + IconSettings, + IconTag, + IconUserCog, + IconUsers + } from "@tabler/icons-react"; import { type SidebarData } from "../types"; export const sidebarData: SidebarData = { @@ -22,11 +16,11 @@ export const sidebarData: SidebarData = { { title: "Dashboard", items: [ - { - title: "Dashboard", - url: "/dashboard", - icon: IconLayoutDashboard, - }, + // { + // title: "Dashboard", + // url: "/dashboard", + // icon: IconLayoutDashboard, + // }, { title: "Shop", url: "/dashboard/shop", @@ -37,11 +31,6 @@ export const sidebarData: SidebarData = { url: "/dashboard/products", icon: IconPackage, }, - { - title: "Inventory", - url: "/dashboard/tasks", - icon: IconForklift, - }, { title: "Sales", icon: IconCoin, @@ -77,33 +66,14 @@ export const sidebarData: SidebarData = { url: "/dashboard/settings", icon: IconUserCog, }, - { - title: "Account", - url: "/dashboard/settings/account", - icon: IconTool, - }, { title: "Appearance", url: "/dashboard/settings/appearance", icon: IconPalette, - }, - { - title: "Notifications", - url: "/dashboard/settings/notifications", - icon: IconNotification, - }, - { - title: "Display", - url: "/dashboard/settings/display", - icon: IconBrowserCheck, - }, + } ], }, - { - title: "Help Center", - url: "/help-center", - icon: IconHelp, - }, + ], }, ], diff --git a/frontend/src/components/layout/nav-user.tsx b/frontend/src/components/layout/nav-user.tsx deleted file mode 100644 index 3545632..0000000 --- a/frontend/src/components/layout/nav-user.tsx +++ /dev/null @@ -1,114 +0,0 @@ -import { Link } from "@tanstack/react-router"; -import { - BadgeCheck, - Bell, - ChevronsUpDown, - CreditCard, - LogOut, - Sparkles, -} from "lucide-react"; -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuGroup, - DropdownMenuItem, - DropdownMenuLabel, - DropdownMenuSeparator, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { - SidebarMenu, - SidebarMenuButton, - SidebarMenuItem, - useSidebar, -} from "@/components/ui/sidebar"; - -export function NavUser({ - user, -}: { - user: { - name: string; - email: string; - avatar: string; - }; -}) { - const { isMobile } = useSidebar(); - - return ( - - - - - - - - SN - -
- {user.name} - {user.email} -
- -
-
- - -
- - - SN - -
- {user.name} - {user.email} -
-
-
- - - - - Upgrade to Pro - - - - - - - - Account - - - - - - Billing - - - - - - Notifications - - - - - - - Log out - -
-
-
-
- ); -} diff --git a/frontend/src/components/main-navbar.tsx b/frontend/src/components/main-navbar.tsx index 208975e..88196e7 100644 --- a/frontend/src/components/main-navbar.tsx +++ b/frontend/src/components/main-navbar.tsx @@ -18,9 +18,9 @@ const MainNavbar = () => {
  • Home
  • -
  • + {/*
  • Pricing -
  • + */}
  • FAQs
  • @@ -43,9 +43,9 @@ const MainNavbar = () => { Features - + {/* Pricing - + */} FAQs diff --git a/frontend/src/components/profile-dropdown.tsx b/frontend/src/components/profile-dropdown.tsx index 52a8864..1bdce51 100644 --- a/frontend/src/components/profile-dropdown.tsx +++ b/frontend/src/components/profile-dropdown.tsx @@ -45,12 +45,6 @@ export function ProfileDropdown() { - - - Profile - ⇧⌘P - - Settings diff --git a/frontend/src/components/ui/calendar.tsx b/frontend/src/components/ui/calendar.tsx deleted file mode 100644 index f4314c0..0000000 --- a/frontend/src/components/ui/calendar.tsx +++ /dev/null @@ -1,68 +0,0 @@ -import * as React from "react"; -import { ChevronLeft, ChevronRight } from "lucide-react"; -import { DayPicker } from "react-day-picker"; - -import { cn } from "@/lib/utils"; -import { buttonVariants } from "@/components/ui/button"; - -export type CalendarProps = React.ComponentProps; - -function Calendar({ - className, - classNames, - showOutsideDays = true, - ...props -}: CalendarProps) { - return ( - ( - - ), - IconRight: ({ className, ...props }) => ( - - ), - }} - {...props} - /> - ); -} -Calendar.displayName = "Calendar"; - -export { Calendar }; diff --git a/frontend/src/hooks/usePurchase.ts b/frontend/src/hooks/usePurchase.ts index 08be1c8..82f8863 100644 --- a/frontend/src/hooks/usePurchase.ts +++ b/frontend/src/hooks/usePurchase.ts @@ -1,9 +1,14 @@ -import { useQuery } from "@tanstack/react-query"; -import { PurchaseWithDetails } from "@/api/mock/models"; +import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query"; +import { + Purchase, + PurchaseWithDetails, +} from "@/api/mock/models"; import { purchaseAPI } from "@/api/api"; export function usePurchase(purchaseId?: number) { - return useQuery({ + const queryClient = useQueryClient(); + + const purchase = useQuery({ queryKey: ["purchase", purchaseId], queryFn: () => { if (purchaseId === undefined) return Promise.resolve(null); @@ -11,4 +16,34 @@ export function usePurchase(purchaseId?: number) { }, enabled: purchaseId !== undefined, }); + + const createPurchase = useMutation({ + mutationFn: (data: Omit) => purchaseAPI.createPurchase(data), + onSuccess: () => { + queryClient.invalidateQueries({ queryKey: ["purchases"] }); + }, + }); + + const updatePurchase = useMutation({ + mutationFn: (data: Purchase) => purchaseAPI.updatePurchase(data.id, data), + onSuccess: (_, updatedPurchase) => { + queryClient.invalidateQueries({ queryKey: ["purchases"] }); + queryClient.invalidateQueries({ queryKey: ["purchase", updatedPurchase.id] }); + }, + }); + + const deletePurchase = useMutation({ + mutationFn: (id: number) => purchaseAPI.deletePurchase(id), + onSuccess: (_, id) => { + queryClient.invalidateQueries({ queryKey: ["purchases"] }); + queryClient.removeQueries({ queryKey: ["purchase", id] }); + }, + }); + + return { + purchase, + createPurchase, + updatePurchase, + deletePurchase, + }; } diff --git a/frontend/src/pages/home/index.tsx b/frontend/src/pages/home/index.tsx index 907210f..824492f 100644 --- a/frontend/src/pages/home/index.tsx +++ b/frontend/src/pages/home/index.tsx @@ -1,7 +1,7 @@ import MainNavbar from "@/components/main-navbar"; import Features from "./components/features"; import Hero from "./components/hero"; -import Pricing from "./components/pricing"; +// import Pricing from "./components/pricing"; import Faq from "./components/faq"; import CallToAction from "./components/call-to-action"; @@ -14,7 +14,7 @@ export default function MainPage() {
    - + {/* */} diff --git a/frontend/src/pages/products/components/product-form.tsx b/frontend/src/pages/products/components/product-form.tsx index 53388f4..b1f788e 100644 --- a/frontend/src/pages/products/components/product-form.tsx +++ b/frontend/src/pages/products/components/product-form.tsx @@ -5,6 +5,7 @@ import { Label } from "@/components/ui/label"; import { UseFormReturn } from "react-hook-form"; import { z } from "zod"; +// eslint-disable-next-line @typescript-eslint/no-unused-vars const schema = z.object({ name: z.string().min(1, "Name is required"), description: z.string().min(1, "Description is required"), @@ -18,12 +19,11 @@ type ProductForm = z.infer; export function ProductForm({ onSubmit, form, - imagePreview, onImageUpload, submitLabel, }: { onSubmit: () => void; - form: UseFormReturn; + form: UseFormReturn; imagePreview?: string; onImageUpload: (e: React.ChangeEvent) => void; submitLabel: string; diff --git a/frontend/src/pages/sales/coupons/components/coupon-columns.tsx b/frontend/src/pages/sales/coupons/components/coupon-columns.tsx index 46c85cc..0bcff3f 100644 --- a/frontend/src/pages/sales/coupons/components/coupon-columns.tsx +++ b/frontend/src/pages/sales/coupons/components/coupon-columns.tsx @@ -96,6 +96,7 @@ export const columns: ColumnDef[] = [ ); }, filterFn: (row, id, value) => { + console.log(id); const validDue = new Date(row.original.valid_due); const now = new Date(); const status = isBefore(validDue, now) ? "expired" : "active"; diff --git a/frontend/src/pages/sales/coupons/components/data-table-toolbar.tsx b/frontend/src/pages/sales/coupons/components/data-table-toolbar.tsx index 0477141..33abd18 100644 --- a/frontend/src/pages/sales/coupons/components/data-table-toolbar.tsx +++ b/frontend/src/pages/sales/coupons/components/data-table-toolbar.tsx @@ -27,9 +27,9 @@ export function DataTableToolbar({ className="h-8 w-[150px] lg:w-[250px]" />
    - {table.getColumn("valid_due") && ( + {table.getColumn("Valid Due") && ( ({ ...t }))} /> diff --git a/frontend/src/pages/sales/coupons/index.tsx b/frontend/src/pages/sales/coupons/index.tsx index dd48508..3a76a9b 100644 --- a/frontend/src/pages/sales/coupons/index.tsx +++ b/frontend/src/pages/sales/coupons/index.tsx @@ -24,8 +24,6 @@ export default function Coupons() { } } - console.log(couponList); - return (
    diff --git a/frontend/src/pages/tasks/components/data-table-column-header.tsx b/frontend/src/pages/sales/recent-sales/components/data-table-column-header.tsx similarity index 100% rename from frontend/src/pages/tasks/components/data-table-column-header.tsx rename to frontend/src/pages/sales/recent-sales/components/data-table-column-header.tsx diff --git a/frontend/src/pages/tasks/components/data-table-faceted-filter.tsx b/frontend/src/pages/sales/recent-sales/components/data-table-faceted-filter.tsx similarity index 94% rename from frontend/src/pages/tasks/components/data-table-faceted-filter.tsx rename to frontend/src/pages/sales/recent-sales/components/data-table-faceted-filter.tsx index 7b6282f..5275546 100644 --- a/frontend/src/pages/tasks/components/data-table-faceted-filter.tsx +++ b/frontend/src/pages/sales/recent-sales/components/data-table-faceted-filter.tsx @@ -37,12 +37,11 @@ export function DataTableFacetedFilter({ }: DataTableFacetedFilterProps) { const facets = column?.getFacetedUniqueValues(); const selectedValues = new Set(column?.getFilterValue() as string[]); - return ( + + + { + setCurrentRow(row.original); + setOpen("view"); + }}> + View + + + + + + + ); +} diff --git a/frontend/src/pages/tasks/components/data-table-toolbar.tsx b/frontend/src/pages/sales/recent-sales/components/data-table-toolbar.tsx similarity index 66% rename from frontend/src/pages/tasks/components/data-table-toolbar.tsx rename to frontend/src/pages/sales/recent-sales/components/data-table-toolbar.tsx index 95a0993..0477141 100644 --- a/frontend/src/pages/tasks/components/data-table-toolbar.tsx +++ b/frontend/src/pages/sales/recent-sales/components/data-table-toolbar.tsx @@ -2,9 +2,9 @@ import { Cross2Icon } from "@radix-ui/react-icons"; import { Table } from "@tanstack/react-table"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; -import { DataTableViewOptions } from "../components/data-table-view-options"; -import { priorities, statuses } from "../data/data"; +import { couponTypes } from "../data/data"; import { DataTableFacetedFilter } from "./data-table-faceted-filter"; +import { DataTableViewOptions } from "./data-table-view-options"; interface DataTableToolbarProps { table: Table; @@ -19,26 +19,19 @@ export function DataTableToolbar({
    - table.getColumn("title")?.setFilterValue(event.target.value) + table.getColumn("name")?.setFilterValue(event.target.value) } className="h-8 w-[150px] lg:w-[250px]" />
    - {table.getColumn("status") && ( + {table.getColumn("valid_due") && ( - )} - {table.getColumn("priority") && ( - ({ ...t }))} /> )}
    diff --git a/frontend/src/pages/tasks/components/data-table-view-options.tsx b/frontend/src/pages/sales/recent-sales/components/data-table-view-options.tsx similarity index 100% rename from frontend/src/pages/tasks/components/data-table-view-options.tsx rename to frontend/src/pages/sales/recent-sales/components/data-table-view-options.tsx diff --git a/frontend/src/pages/sales/recent-sales/components/purchase-action-dialog.tsx b/frontend/src/pages/sales/recent-sales/components/purchase-action-dialog.tsx new file mode 100644 index 0000000..722fc84 --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/components/purchase-action-dialog.tsx @@ -0,0 +1,219 @@ +"use client"; + +import { z } from "zod"; +import { useForm } from "react-hook-form"; +import { zodResolver } from "@hookform/resolvers/zod"; +import { toast } from "@/hooks/useToast"; +import { Button } from "@/components/ui/button"; +import { + Dialog, + DialogContent, + DialogDescription, + DialogFooter, + DialogHeader, + DialogTitle +} from "@/components/ui/dialog"; +import { + Form, + FormControl, + FormField, + FormItem, + FormLabel, + FormMessage +} from "@/components/ui/form"; +import { Input } from "@/components/ui/input"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { Purchase } from "../data/schema"; +import { usePurchase } from "@/hooks/usePurchase"; + +const formSchema = z.object({ + user_id: z.number({ invalid_type_error: "User ID must be a number." }), + used_coupon_id: z.number().nullable().optional(), + total: z + .number({ invalid_type_error: "Total must be a number." }) + .min(0, { message: "Total must be at least 0." }), + date_purchased: z.coerce.date({ + errorMap: () => ({ message: "Invalid date." }) + }), + isEdit: z.boolean() +}); + +type PurchaseForm = z.infer; + +interface Props { + currentRow?: Purchase; + open: boolean; + onOpenChange: (open: boolean) => void; +} + +export function PurchasesActionDialog({ + currentRow, + open, + onOpenChange +}: Props) { + const { createPurchase, updatePurchase } = usePurchase(currentRow?.id); + const isEdit = !!currentRow; + + const form = useForm({ + resolver: zodResolver(formSchema), + defaultValues: isEdit + ? { + ...currentRow, + date_purchased: new Date(currentRow.date_purchased), + isEdit + } + : { + user_id: 0, + used_coupon_id: null, + total: 0, + date_purchased: new Date(), + isEdit + } + }); + + const onSubmit = (values: PurchaseForm) => { + try { + const payload = { + ...values, + date_purchased: values.date_purchased.toISOString() + }; + + if (isEdit) { + updatePurchase.mutate({ ...currentRow, ...payload }); + } else { + createPurchase.mutate({...payload, used_coupon_id: payload.used_coupon_id ?? null }); + } + + toast({ + title: isEdit ? "Purchase updated" : "Purchase created", + description: `User #${values.user_id} • ${values.total.toFixed(2)}€` + }); + form.reset(); + onOpenChange(false); + } catch (err) { + toast({ + title: "An error occurred", + description: (err as Error).message, + variant: "destructive" + }); + } + }; + + return ( + { + form.reset(); + onOpenChange(state); + }}> + + + + {isEdit ? "Edit Purchase" : "Add New Purchase"} + + + {isEdit + ? "Update the purchase details below." + : "Record a new purchase."} + + + + +
    + + ( + + User ID + + field.onChange(Number(e.target.value))} + /> + + + + )} + /> + + ( + + Coupon ID (optional) + + { + const value = e.target.value; + field.onChange(value === "" ? null : Number(value)); + }} + /> + + + + )} + /> + + ( + + Total (€) + + field.onChange(Number(e.target.value))} + /> + + + + )} + /> + + ( + + Purchase Date + + + field.onChange(new Date(e.target.value)) + } + /> + + + + )} + /> + + +
    + + + + +
    +
    + ); +} diff --git a/frontend/src/pages/sales/recent-sales/components/purchase-columns.tsx b/frontend/src/pages/sales/recent-sales/components/purchase-columns.tsx new file mode 100644 index 0000000..dabfbca --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/components/purchase-columns.tsx @@ -0,0 +1,95 @@ +import { ColumnDef } from "@tanstack/react-table"; +import { Checkbox } from "@/components/ui/checkbox"; +import { cn } from "@/lib/utils"; +import { Purchase } from "../data/schema"; +import { DataTableColumnHeader } from "./data-table-column-header"; +import { DataTableRowActions } from "./data-table-row-actions"; +import { format } from "date-fns"; +import { Badge } from "@/components/ui/badge"; +import { Coupon } from "@/api/mock/models"; + +export function getColumns( + couponsMap: Map +): ColumnDef[] { + return [ + { + id: "select", + header: ({ table }) => ( + table.toggleAllPageRowsSelected(!!value)} + aria-label="Select all" + className="translate-y-[2px]" + /> + ), + meta: { + className: cn( + "sticky md:table-cell left-0 z-10 rounded-tl", + "bg-background transition-colors duration-200 group-hover/row:bg-muted group-data-[state=selected]/row:bg-muted" + ) + }, + cell: ({ row }) => ( + row.toggleSelected(!!value)} + aria-label="Select row" + className="translate-y-[2px]" + /> + ), + enableSorting: false, + enableHiding: false + }, + { + accessorKey: "id", + header: ({ column }) => ( + + ), + cell: ({ row }) => ( +
    {row.getValue("id")}
    + ), + enableHiding: false + }, + { + accessorKey: "total", + header: ({ column }) => ( + + ), + cell: ({ row }) => { + const value = row.getValue("total") as number; + return
    {value.toFixed(2)}
    ; + } + }, + { + accessorKey: "date_purchased", + header: ({ column }) => ( + + ), + cell: ({ row }) => { + const date = new Date(row.getValue("date_purchased")); + return
    {format(date, "PPPp")}
    ; + } + }, + { + accessorKey: "used_coupon_id", + header: ({ column }) => ( + + ), + cell: ({ row }) => { + const { used_coupon_id } = row.original; + const coupon = used_coupon_id ? couponsMap.get(used_coupon_id) : null; + return coupon ? ( + {coupon.name} + ) : ( + + ); + } + }, + { + id: "actions", + cell: DataTableRowActions + } + ]; +} diff --git a/frontend/src/pages/sales/recent-sales/components/purchase-delete-dialog.tsx b/frontend/src/pages/sales/recent-sales/components/purchase-delete-dialog.tsx new file mode 100644 index 0000000..4f222ac --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/components/purchase-delete-dialog.tsx @@ -0,0 +1,65 @@ +"use client"; + +import { toast } from "@/hooks/useToast"; +import { IconAlertTriangle } from "@tabler/icons-react"; +import { ConfirmDialog } from "@/components/confirm-dialog"; +import { Purchase } from "../data/schema"; +import { usePurchase } from "@/hooks/usePurchase"; +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; + +interface Props { + open: boolean; + onOpenChange: (open: boolean) => void; + currentRow: Purchase; +} + +export function PurchasesDeleteDialog({ open, onOpenChange, currentRow }: Props) { + const { deletePurchase } = usePurchase(currentRow.id); + + const handleDelete = () => { + deletePurchase.mutate(currentRow.id); + + onOpenChange(false); + toast({ + title: "Purchase deleted", + description: `Purchase #${currentRow.id} has been successfully removed.`, + }); + }; + + return ( + + {" "} + Delete Purchase + + } + desc={ +
    +

    + Are you sure you want to delete{" "} + purchase #{currentRow.id}? +
    + This action cannot be undone. +

    + + + Warning! + + This will permanently remove this purchase and all associated + entries. + + +
    + } + confirmText="Delete" + destructive + /> + ); +} diff --git a/frontend/src/pages/sales/recent-sales/components/purchase-dialog.tsx b/frontend/src/pages/sales/recent-sales/components/purchase-dialog.tsx new file mode 100644 index 0000000..c3c0895 --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/components/purchase-dialog.tsx @@ -0,0 +1,45 @@ +import { usePurchasesContext } from "../context/purchase-context"; +import { PurchasesActionDialog } from "./purchase-action-dialog"; +import { PurchasesDeleteDialog } from "./purchase-delete-dialog"; + +export function PurchasesDialogs() { + const { open, setOpen, currentRow, setCurrentRow } = usePurchasesContext(); + + return ( + <> + setOpen("add")} + /> + + {currentRow && ( + <> + { + setOpen("view"); + setTimeout(() => { + setCurrentRow(null); + }, 500); + }} + currentRow={currentRow} + /> + + { + setOpen("delete"); + setTimeout(() => { + setCurrentRow(null); + }, 500); + }} + currentRow={currentRow} + /> + + )} + + ); +} diff --git a/frontend/src/pages/sales/recent-sales/components/purchase-primary-buttons.tsx b/frontend/src/pages/sales/recent-sales/components/purchase-primary-buttons.tsx new file mode 100644 index 0000000..3db72bf --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/components/purchase-primary-buttons.tsx @@ -0,0 +1,14 @@ +import { IconPlus } from "@tabler/icons-react"; +import { Button } from "@/components/ui/button"; +import { usePurchasesContext } from "../context/purchase-context"; + +export function PurchasePrimaryButtons() { + const { setOpen } = usePurchasesContext(); + return ( +
    + +
    + ); +} diff --git a/frontend/src/pages/tasks/components/data-table.tsx b/frontend/src/pages/sales/recent-sales/components/purchase-table.tsx similarity index 56% rename from frontend/src/pages/tasks/components/data-table.tsx rename to frontend/src/pages/sales/recent-sales/components/purchase-table.tsx index edbbe01..267af5c 100644 --- a/frontend/src/pages/tasks/components/data-table.tsx +++ b/frontend/src/pages/sales/recent-sales/components/purchase-table.tsx @@ -1,7 +1,8 @@ -import * as React from "react"; +import { useState } from "react"; import { ColumnDef, ColumnFiltersState, + RowData, SortingState, VisibilityState, flexRender, @@ -21,25 +22,27 @@ import { TableHeader, TableRow, } from "@/components/ui/table"; -import { DataTablePagination } from "../components/data-table-pagination"; -import { DataTableToolbar } from "../components/data-table-toolbar"; +import { Purchase } from "../data/schema"; +import { DataTablePagination } from "./data-table-pagination"; +import { DataTableToolbar } from "./data-table-toolbar"; -interface DataTableProps { - columns: ColumnDef[]; - data: TData[]; +declare module "@tanstack/react-table" { + // eslint-disable-next-line @typescript-eslint/no-unused-vars + interface ColumnMeta { + className: string; + } } -export function DataTable({ - columns, - data, -}: DataTableProps) { - const [rowSelection, setRowSelection] = React.useState({}); - const [columnVisibility, setColumnVisibility] = - React.useState({}); - const [columnFilters, setColumnFilters] = React.useState( - [], - ); - const [sorting, setSorting] = React.useState([]); +interface DataTableProps { + columns: ColumnDef[]; + data: Purchase[]; +} + +export function PurchasesTable({ columns, data }: DataTableProps) { + const [rowSelection, setRowSelection] = useState({}); + const [columnVisibility, setColumnVisibility] = useState({}); + const [columnFilters, setColumnFilters] = useState([]); + const [sorting, setSorting] = useState([]); const table = useReactTable({ data, @@ -70,31 +73,37 @@ export function DataTable({ {table.getHeaderGroups().map((headerGroup) => ( - - {headerGroup.headers.map((header) => { - return ( - - {header.isPlaceholder - ? null - : flexRender( - header.column.columnDef.header, - header.getContext(), - )} - - ); - })} + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext(), + )} + + ))} ))} - {table.getRowModel().rows?.length ? ( + {table.getRowModel().rows.length ? ( table.getRowModel().rows.map((row) => ( {row.getVisibleCells().map((cell) => ( - + {flexRender( cell.column.columnDef.cell, cell.getContext(), diff --git a/frontend/src/pages/sales/recent-sales/context/purchase-context.tsx b/frontend/src/pages/sales/recent-sales/context/purchase-context.tsx new file mode 100644 index 0000000..5220079 --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/context/purchase-context.tsx @@ -0,0 +1,42 @@ +import React, { useState } from "react"; +import useDialogState from "@/hooks/useDialogState"; +import { Purchase } from "../data/schema"; + +type PurchasesDialogType = "view" | "delete" | "edit" | "add"; + +interface PurchasesContextType { + open: PurchasesDialogType | null; + setOpen: (type: PurchasesDialogType | null) => void; + currentRow: Purchase | null; + setCurrentRow: React.Dispatch>; +} + +const PurchasesContext = React.createContext(null); + +interface Props { + children: React.ReactNode; +} + +export default function PurchasesProvider({ children }: Props) { + const [open, setOpen] = useDialogState(null); + const [currentRow, setCurrentRow] = useState(null); + + return ( + + {children} + + ); +} + +// eslint-disable-next-line react-refresh/only-export-components +export const usePurchasesContext = () => { + const context = React.useContext(PurchasesContext); + + if (!context) { + throw new Error("usePurchasesContext must be used within "); + } + + return context; +}; diff --git a/frontend/src/pages/sales/recent-sales/data/data.ts b/frontend/src/pages/sales/recent-sales/data/data.ts new file mode 100644 index 0000000..9507565 --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/data/data.ts @@ -0,0 +1,25 @@ +import { IconClockCancel, IconClock } from "@tabler/icons-react"; + +export const couponStatusColors = new Map<"active" | "expired", string>([ + [ + "active", + "bg-green-100 text-green-800 dark:bg-green-900 dark:text-green-100 border border-green-300 dark:border-green-600", + ], + [ + "expired", + "bg-red-100 text-red-800 dark:bg-red-900 dark:text-red-100 border border-red-300 dark:border-red-600", + ], +]); + +export const couponTypes = [ + { + label: "Active", + value: "active", + icon: IconClock, + }, + { + label: "Expired", + value: "expired", + icon: IconClockCancel, + }, +] as const; diff --git a/frontend/src/pages/sales/recent-sales/data/schema.ts b/frontend/src/pages/sales/recent-sales/data/schema.ts new file mode 100644 index 0000000..21bb7f8 --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/data/schema.ts @@ -0,0 +1,13 @@ +import { z } from "zod"; + +export const purchaseSchema = z.object({ + id: z.number(), + user_id: z.number(), + used_coupon_id: z.number().nullable(), + date_purchased: z.string(), + total: z.number().nonnegative(), +}); + +export type Purchase = z.infer; + +export const purchaseListSchema = z.array(purchaseSchema); diff --git a/frontend/src/pages/sales/recent-sales/index.tsx b/frontend/src/pages/sales/recent-sales/index.tsx new file mode 100644 index 0000000..ee4a61e --- /dev/null +++ b/frontend/src/pages/sales/recent-sales/index.tsx @@ -0,0 +1,75 @@ +import { Header } from "@/components/layout/header"; +import { Main } from "@/components/layout/main"; +import { ProfileDropdown } from "@/components/profile-dropdown"; +import { Search } from "@/components/search"; +import { ThemeSwitch } from "@/components/theme-switch"; +import { getColumns } from "./components/purchase-columns"; +import { PurchasesDialogs } from "./components/purchase-dialog"; +import { PurchasePrimaryButtons } from "./components/purchase-primary-buttons"; +import { PurchasesTable } from "./components/purchase-table"; +import PurchasesProvider from "./context/purchase-context"; +import { usePurchases } from "@/hooks/usePurchases"; +import { Coupon, Purchase } from "@/api/mock/models"; +import { purchaseListSchema } from "./data/schema"; +import { useCoupons } from "@/hooks/useCoupons"; + +export default function RecentSalves() { + const { data, error, isLoading } = usePurchases(); + const { data: couponsData } = useCoupons(); + const couponsMap = new Map(); + couponsData?.forEach((c) => couponsMap.set(c.id, c)); + + let purchaseList: Purchase[] = []; + if (data) { + try { + purchaseList = purchaseListSchema.parse(data); + } catch (e) { + console.error("Schema validation failed:", e); + purchaseList = []; + } + } + + return ( + +
    + +
    + + +
    +
    + +
    +
    +
    +

    Purchases

    +

    + View, and analyze user purchases. +

    +
    + +
    + + {isLoading && ( +

    Loading purchases...

    + )} + {error && ( +

    + Failed to load purchases: {(error as Error).message} +

    + )} + + {!isLoading && !error && ( +
    + +
    + )} +
    + + +
    + ); +} diff --git a/frontend/src/pages/settings/account/account-form.tsx b/frontend/src/pages/settings/account/account-form.tsx deleted file mode 100644 index 02d60f0..0000000 --- a/frontend/src/pages/settings/account/account-form.tsx +++ /dev/null @@ -1,135 +0,0 @@ -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Button } from "@/components/ui/button"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; -import { Input } from "@/components/ui/input"; -import useAuth from "@/hooks/useAuth"; - -// const languages = [ -// { label: "English", value: "en" }, -// { label: "French", value: "fr" }, -// { label: "German", value: "de" }, -// { label: "Spanish", value: "es" }, -// { label: "Portuguese", value: "pt" }, -// { label: "Russian", value: "ru" }, -// { label: "Japanese", value: "ja" }, -// { label: "Korean", value: "ko" }, -// { label: "Chinese", value: "zh" } -// ] as const; - -const accountFormSchema = z.object({ - username: z.string().min(3).max(30), - email: z.string().email(), - phone_number: z.string(), - // password: z.string().min(8).max(128), - first_name: z.string().optional(), - last_name: z.string().optional(), - // dob: z.date({ - // required_error: "A date of birth is required." - // }), - // language: z.string({ - // required_error: "Please select a language." - // }) -}); - -type AccountFormValues = z.infer; - -export function AccountForm() { - const { updateAccountMutation, user } = useAuth(); - - const form = useForm({ - resolver: zodResolver(accountFormSchema), - }); - - function onSubmit(data: AccountFormValues) { - updateAccountMutation.mutate({ - email: data.email, - // password: data.password, - password: "null", - phone_number: data.phone_number, - username: data.username, - first_name: data.first_name, - last_name: data.last_name, - }); - } - - return ( -
    - - ( - - Username - - - - - - )} - /> - ( - - Email - - - - - - )} - /> - ( - - Phone Number - - - - - - )} - /> - ( - - Password - - - - - - )} - /> - - - - ); -} diff --git a/frontend/src/pages/settings/account/index.tsx b/frontend/src/pages/settings/account/index.tsx deleted file mode 100644 index b7363d6..0000000 --- a/frontend/src/pages/settings/account/index.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import ContentSection from "../components/content-section"; -import { AccountForm } from "./account-form"; - -export default function SettingsAccount() { - return ( - - - - ); -} diff --git a/frontend/src/pages/settings/display/display-form.tsx b/frontend/src/pages/settings/display/display-form.tsx deleted file mode 100644 index f43a46f..0000000 --- a/frontend/src/pages/settings/display/display-form.tsx +++ /dev/null @@ -1,129 +0,0 @@ -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { toast } from "@/hooks/useToast"; -import { Button } from "@/components/ui/button"; -import { Checkbox } from "@/components/ui/checkbox"; -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; - -const items = [ - { - id: "recents", - label: "Recents", - }, - { - id: "home", - label: "Home", - }, - { - id: "applications", - label: "Applications", - }, - { - id: "desktop", - label: "Desktop", - }, - { - id: "downloads", - label: "Downloads", - }, - { - id: "documents", - label: "Documents", - }, -] as const; - -const displayFormSchema = z.object({ - items: z.array(z.string()).refine((value) => value.some((item) => item), { - message: "You have to select at least one item.", - }), -}); - -type DisplayFormValues = z.infer; - -// This can come from your database or API. -const defaultValues: Partial = { - items: ["recents", "home"], -}; - -export function DisplayForm() { - const form = useForm({ - resolver: zodResolver(displayFormSchema), - defaultValues, - }); - - function onSubmit(data: DisplayFormValues) { - toast({ - title: "You submitted the following values:", - description: ( -
    -					{JSON.stringify(data, null, 2)}
    -				
    - ), - }); - } - - return ( -
    - - ( - -
    - Sidebar - - Select the items you want to display in the sidebar. - -
    - {items.map((item) => ( - { - return ( - - - { - return checked - ? field.onChange([...field.value, item.id]) - : field.onChange( - field.value?.filter( - (value) => value !== item.id, - ), - ); - }} - /> - - - {item.label} - - - ); - }} - /> - ))} - -
    - )} - /> - - - - ); -} diff --git a/frontend/src/pages/settings/display/index.tsx b/frontend/src/pages/settings/display/index.tsx deleted file mode 100644 index 44ead9d..0000000 --- a/frontend/src/pages/settings/display/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import ContentSection from "../components/content-section"; -import { DisplayForm } from "./display-form"; - -export default function SettingsDisplay() { - return ( - - - - ); -} diff --git a/frontend/src/pages/settings/index.tsx b/frontend/src/pages/settings/index.tsx index 983e3b3..9cd0760 100644 --- a/frontend/src/pages/settings/index.tsx +++ b/frontend/src/pages/settings/index.tsx @@ -1,11 +1,9 @@ import { Outlet } from "@tanstack/react-router"; -import { - IconBrowserCheck, - IconLock, - IconNotification, - IconPalette, - IconUser, -} from "@tabler/icons-react"; +import + { + IconLock, IconPalette, + IconUser + } from "@tabler/icons-react"; import { Separator } from "@/components/ui/separator"; import { Header } from "@/components/layout/header"; import { Main } from "@/components/layout/main"; @@ -64,15 +62,5 @@ const sidebarNavItems = [ title: "Appearance", icon: , href: "/dashboard/settings/appearance", - }, - { - title: "Notifications", - icon: , - href: "/dashboard/settings/notifications", - }, - { - title: "Display", - icon: , - href: "/dashboard/settings/display", - }, + } ]; diff --git a/frontend/src/pages/settings/notifications/index.tsx b/frontend/src/pages/settings/notifications/index.tsx deleted file mode 100644 index d5e53ab..0000000 --- a/frontend/src/pages/settings/notifications/index.tsx +++ /dev/null @@ -1,13 +0,0 @@ -import ContentSection from "../components/content-section"; -import { NotificationsForm } from "./notifications-form"; - -export default function SettingsNotifications() { - return ( - - - - ); -} diff --git a/frontend/src/pages/settings/notifications/notifications-form.tsx b/frontend/src/pages/settings/notifications/notifications-form.tsx deleted file mode 100644 index a99305a..0000000 --- a/frontend/src/pages/settings/notifications/notifications-form.tsx +++ /dev/null @@ -1,225 +0,0 @@ -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Link } from "@tanstack/react-router"; -import { toast } from "@/hooks/useToast"; -import { Button } from "@/components/ui/button"; -import { Checkbox } from "@/components/ui/checkbox"; -import { - Form, - FormControl, - FormDescription, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; -import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; -import { Switch } from "@/components/ui/switch"; - -const notificationsFormSchema = z.object({ - type: z.enum(["all", "mentions", "none"], { - required_error: "You need to select a notification type.", - }), - mobile: z.boolean().default(false).optional(), - communication_emails: z.boolean().default(false).optional(), - social_emails: z.boolean().default(false).optional(), - marketing_emails: z.boolean().default(false).optional(), - security_emails: z.boolean(), -}); - -type NotificationsFormValues = z.infer; - -// This can come from your database or API. -const defaultValues: Partial = { - communication_emails: false, - marketing_emails: false, - social_emails: true, - security_emails: true, -}; - -export function NotificationsForm() { - const form = useForm({ - resolver: zodResolver(notificationsFormSchema), - defaultValues, - }); - - function onSubmit(data: NotificationsFormValues) { - toast({ - title: "You submitted the following values:", - description: ( -
    -					{JSON.stringify(data, null, 2)}
    -				
    - ), - }); - } - - return ( -
    - - ( - - Notify me about... - - - - - - - - All new messages - - - - - - - - Direct messages and mentions - - - - - - - Nothing - - - - - - )} - /> -
    -

    Email Notifications

    -
    - ( - -
    - - Communication emails - - - Receive emails about your account activity. - -
    - - - -
    - )} - /> - ( - -
    - - Marketing emails - - - Receive emails about new products, features, and more. - -
    - - - -
    - )} - /> - ( - -
    - Social emails - - Receive emails for friend requests, follows, and more. - -
    - - - -
    - )} - /> - ( - -
    - Security emails - - Receive emails about your account activity and security. - -
    - - - -
    - )} - /> -
    -
    - ( - - - - -
    - - Use different settings for my mobile devices - - - You can manage your mobile notifications in the{" "} - - mobile settings - {" "} - page. - -
    -
    - )} - /> - - - - ); -} diff --git a/frontend/src/pages/settings/security/index.tsx b/frontend/src/pages/settings/security/index.tsx deleted file mode 100644 index 18c4c26..0000000 --- a/frontend/src/pages/settings/security/index.tsx +++ /dev/null @@ -1,10 +0,0 @@ -import ContentSection from "../components/content-section"; -import PasswordChangeForm from "./security-form"; - -export default function SettingsSecurity() { - return ( - - - - ); -} diff --git a/frontend/src/pages/settings/security/security-form.tsx b/frontend/src/pages/settings/security/security-form.tsx deleted file mode 100644 index d2ecdcf..0000000 --- a/frontend/src/pages/settings/security/security-form.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { Button } from "@/components/ui/button"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; -import { PasswordInput } from "@/components/password-input"; -import { toast } from "@/hooks/useToast"; - -const passwordChangeSchema = z - .object({ - oldPassword: z.string().min(1, { - message: "Please enter your existing password", - }), - newPassword: z - .string() - .min(1, { message: "Please enter your new password" }) - .min(8, { message: "Password must be at least 8 characters long" }) - .max(128, { message: "Password must be at most 128 characters long" }) - .refine((password) => /[A-Z]/.test(password), { - message: "Password must contain at least one uppercase letter", - }) - .refine((password) => /[a-z]/.test(password), { - message: "Password must contain at least one lowercase letter", - }) - .refine((password) => /\d/.test(password), { - message: "Password must contain at least one number", - }) - .refine((password) => /[@$!%*?&]/.test(password), { - message: - "Password must contain at least one special character (@, $, !, %, *, ?, &)", - }), - confirmNewPassword: z.string().min(1, { - message: "Please confirm your new password", - }), - }) - .refine((data) => data.newPassword === data.confirmNewPassword, { - message: "Passwords don't match.", - path: ["confirmNewPassword"], - }); - -type PasswordChangeFormValues = z.infer; - -export default function PasswordChangeForm() { - const form = useForm({ - resolver: zodResolver(passwordChangeSchema), - defaultValues: { - oldPassword: "", - newPassword: "", - confirmNewPassword: "", - }, - }); - - function onSubmit(data: PasswordChangeFormValues) { - toast({ - title: "Password Changed (MOCK)", - description: "Your password has been updated.", - }); - } - - return ( -
    - - ( - - Existing Password - - - - - - )} - /> - ( - - New Password - - - - - - )} - /> - ( - - Confirm New Password - - - - - - )} - /> - - - - ); -} diff --git a/frontend/src/pages/shop/components/shop-sidebar.tsx b/frontend/src/pages/shop/components/shop-sidebar.tsx index 8a311c6..8ad44bb 100644 --- a/frontend/src/pages/shop/components/shop-sidebar.tsx +++ b/frontend/src/pages/shop/components/shop-sidebar.tsx @@ -17,6 +17,7 @@ import { Badge } from "@/components/ui/badge"; import { IconBuildingStore, IconClock, IconLink } from "@tabler/icons-react"; export default function ShopSidebar({ ...props }) { + console.log(props); const { pathname } = useLocation(); const navigate = useNavigate(); const [val, setVal] = useState(pathname ?? "/settings"); diff --git a/frontend/src/pages/shop/index.tsx b/frontend/src/pages/shop/index.tsx index 79a9bfb..596d40e 100644 --- a/frontend/src/pages/shop/index.tsx +++ b/frontend/src/pages/shop/index.tsx @@ -4,7 +4,7 @@ import { ProfileDropdown } from "@/components/profile-dropdown"; import { ThemeSwitch } from "@/components/theme-switch"; import { ShopAboutForm } from "./components/shop-about-form"; import { Search } from "@/components/search"; -import ShopSidebar from "./components/shop-sidebar"; +// import ShopSidebar from "./components/shop-sidebar"; import { Separator } from "@/components/ui/separator"; export default function AboutPage() { @@ -30,7 +30,7 @@ export default function AboutPage() {
    - + {/* */}
    diff --git a/frontend/src/pages/tasks/components/columns.tsx b/frontend/src/pages/tasks/components/columns.tsx deleted file mode 100644 index 6ae2735..0000000 --- a/frontend/src/pages/tasks/components/columns.tsx +++ /dev/null @@ -1,119 +0,0 @@ -import { ColumnDef } from "@tanstack/react-table"; -import { Badge } from "@/components/ui/badge"; -import { Checkbox } from "@/components/ui/checkbox"; -import { labels, priorities, statuses } from "../data/data"; -import { Task } from "../data/schema"; -import { DataTableColumnHeader } from "./data-table-column-header"; -import { DataTableRowActions } from "./data-table-row-actions"; - -export const columns: ColumnDef[] = [ - { - id: "select", - header: ({ table }) => ( - table.toggleAllPageRowsSelected(!!value)} - aria-label="Select all" - className="translate-y-[2px]" - /> - ), - cell: ({ row }) => ( - row.toggleSelected(!!value)} - aria-label="Select row" - className="translate-y-[2px]" - /> - ), - enableSorting: false, - enableHiding: false, - }, - { - accessorKey: "id", - header: ({ column }) => ( - - ), - cell: ({ row }) =>
    {row.getValue("id")}
    , - enableSorting: false, - enableHiding: false, - }, - { - accessorKey: "title", - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const label = labels.find((label) => label.value === row.original.label); - - return ( -
    - {label && {label.label}} - - {row.getValue("title")} - -
    - ); - }, - }, - { - accessorKey: "status", - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const status = statuses.find( - (status) => status.value === row.getValue("status"), - ); - - if (!status) { - return null; - } - - return ( -
    - {status.icon && ( - - )} - {status.label} -
    - ); - }, - filterFn: (row, id, value) => { - return value.includes(row.getValue(id)); - }, - }, - { - accessorKey: "priority", - header: ({ column }) => ( - - ), - cell: ({ row }) => { - const priority = priorities.find( - (priority) => priority.value === row.getValue("priority"), - ); - - if (!priority) { - return null; - } - - return ( -
    - {priority.icon && ( - - )} - {priority.label} -
    - ); - }, - filterFn: (row, id, value) => { - return value.includes(row.getValue(id)); - }, - }, - { - id: "actions", - cell: ({ row }) => , - }, -]; diff --git a/frontend/src/pages/tasks/components/data-table-row-actions.tsx b/frontend/src/pages/tasks/components/data-table-row-actions.tsx deleted file mode 100644 index 26e23ae..0000000 --- a/frontend/src/pages/tasks/components/data-table-row-actions.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { DotsHorizontalIcon } from "@radix-ui/react-icons"; -import { Row } from "@tanstack/react-table"; -import { IconTrash } from "@tabler/icons-react"; -import { Button } from "@/components/ui/button"; -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuRadioGroup, - DropdownMenuRadioItem, - DropdownMenuSeparator, - DropdownMenuShortcut, - DropdownMenuSub, - DropdownMenuSubContent, - DropdownMenuSubTrigger, - DropdownMenuTrigger, -} from "@/components/ui/dropdown-menu"; -import { useTasks } from "../context/tasks-context"; -import { labels } from "../data/data"; -import { taskSchema } from "../data/schema"; - -interface DataTableRowActionsProps { - row: Row; -} - -export function DataTableRowActions({ - row, -}: DataTableRowActionsProps) { - const task = taskSchema.parse(row.original); - - const { setOpen, setCurrentRow } = useTasks(); - - return ( - - - - - - { - setCurrentRow(task); - setOpen("update"); - }} - > - Edit - - Make a copy - Favorite - - - Labels - - - {labels.map((label) => ( - - {label.label} - - ))} - - - - - { - setCurrentRow(task); - setOpen("delete"); - }} - > - Delete - - - - - - - ); -} diff --git a/frontend/src/pages/tasks/components/tasks-dialogs.tsx b/frontend/src/pages/tasks/components/tasks-dialogs.tsx deleted file mode 100644 index ee1cbe7..0000000 --- a/frontend/src/pages/tasks/components/tasks-dialogs.tsx +++ /dev/null @@ -1,78 +0,0 @@ -import { toast } from "@/hooks/useToast"; -import { ConfirmDialog } from "@/components/confirm-dialog"; -import { useTasks } from "../context/tasks-context"; -import { TasksImportDialog } from "./tasks-import-dialog"; -import { TasksMutateDrawer } from "./tasks-mutate-drawer"; - -export function TasksDialogs() { - const { open, setOpen, currentRow, setCurrentRow } = useTasks(); - return ( - <> - setOpen("create")} - /> - - setOpen("import")} - /> - - {currentRow && ( - <> - { - setOpen("update"); - setTimeout(() => { - setCurrentRow(null); - }, 500); - }} - currentRow={currentRow} - /> - - { - setOpen("delete"); - setTimeout(() => { - setCurrentRow(null); - }, 500); - }} - handleConfirm={() => { - setOpen(null); - setTimeout(() => { - setCurrentRow(null); - }, 500); - toast({ - title: "The following task has been deleted:", - description: ( -
    -										
    -											{JSON.stringify(currentRow, null, 2)}
    -										
    -									
    - ), - }); - }} - className="max-w-md" - title={`Delete this task: ${currentRow.id} ?`} - desc={ - <> - You are about to delete a task with the ID{" "} - {currentRow.id}.
    - This action cannot be undone. - - } - confirmText="Delete" - /> - - )} - - ); -} diff --git a/frontend/src/pages/tasks/components/tasks-import-dialog.tsx b/frontend/src/pages/tasks/components/tasks-import-dialog.tsx deleted file mode 100644 index e4da1a2..0000000 --- a/frontend/src/pages/tasks/components/tasks-import-dialog.tsx +++ /dev/null @@ -1,116 +0,0 @@ -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { toast } from "@/hooks/useToast"; -import { Button } from "@/components/ui/button"; -import { - Dialog, - DialogClose, - DialogContent, - DialogDescription, - DialogFooter, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; -import { Input } from "@/components/ui/input"; - -const formSchema = z.object({ - file: z - .instanceof(FileList) - .refine((files) => files.length > 0, { - message: "Please upload a file", - }) - .refine( - (files) => ["text/csv"].includes(files?.[0]?.type), - "Please upload csv format.", - ), -}); - -interface Props { - open: boolean; - onOpenChange: (open: boolean) => void; -} - -export function TasksImportDialog({ open, onOpenChange }: Props) { - const form = useForm>({ - resolver: zodResolver(formSchema), - defaultValues: { file: undefined }, - }); - - const fileRef = form.register("file"); - - const onSubmit = () => { - const file = form.getValues("file"); - - if (file && file[0]) { - const fileDetails = { - name: file[0].name, - size: file[0].size, - type: file[0].type, - }; - toast({ - title: "You have imported the following file:", - description: ( -
    -						
    -							{JSON.stringify(fileDetails, null, 2)}
    -						
    -					
    - ), - }); - } - onOpenChange(false); - }; - - return ( - { - onOpenChange(val); - form.reset(); - }} - > - - - Import Tasks - - Import tasks quickly from a CSV file. - - -
    - - ( - - File - - - - - - )} - /> - - - - - - - - -
    -
    - ); -} diff --git a/frontend/src/pages/tasks/components/tasks-mutate-drawer.tsx b/frontend/src/pages/tasks/components/tasks-mutate-drawer.tsx deleted file mode 100644 index ac7ddd9..0000000 --- a/frontend/src/pages/tasks/components/tasks-mutate-drawer.tsx +++ /dev/null @@ -1,215 +0,0 @@ -import { z } from "zod"; -import { useForm } from "react-hook-form"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { toast } from "@/hooks/useToast"; -import { Button } from "@/components/ui/button"; -import { - Form, - FormControl, - FormField, - FormItem, - FormLabel, - FormMessage, -} from "@/components/ui/form"; -import { Input } from "@/components/ui/input"; -import { RadioGroup, RadioGroupItem } from "@/components/ui/radio-group"; -import { - Sheet, - SheetClose, - SheetContent, - SheetDescription, - SheetFooter, - SheetHeader, - SheetTitle, -} from "@/components/ui/sheet"; -import { SelectDropdown } from "@/components/select-dropdown"; -import { Task } from "../data/schema"; - -interface Props { - open: boolean; - onOpenChange: (open: boolean) => void; - currentRow?: Task; -} - -const formSchema = z.object({ - title: z.string().min(1, "Title is required."), - status: z.string().min(1, "Please select a status."), - label: z.string().min(1, "Please select a label."), - priority: z.string().min(1, "Please choose a priority."), -}); -type TasksForm = z.infer; - -export function TasksMutateDrawer({ open, onOpenChange, currentRow }: Props) { - const isUpdate = !!currentRow; - - const form = useForm({ - resolver: zodResolver(formSchema), - defaultValues: currentRow ?? { - title: "", - status: "", - label: "", - priority: "", - }, - }); - - const onSubmit = (data: TasksForm) => { - // do something with the form data - onOpenChange(false); - form.reset(); - toast({ - title: "You submitted the following values:", - description: ( -
    -					{JSON.stringify(data, null, 2)}
    -				
    - ), - }); - }; - - return ( - { - onOpenChange(v); - form.reset(); - }} - > - - - {isUpdate ? "Update" : "Create"} Task - - {isUpdate - ? "Update the task by providing necessary info." - : "Add a new task by providing necessary info."} - Click save when you're done. - - -
    - - ( - - Title - - - - - - )} - /> - ( - - Status - - - - )} - /> - ( - - Label - - - - - - - - Documentation - - - - - - - Feature - - - - - - Bug - - - - - - )} - /> - ( - - Priority - - - - - - - High - - - - - - Medium - - - - - - Low - - - - - - )} - /> - - - - - - - - -
    -
    - ); -} diff --git a/frontend/src/pages/tasks/components/tasks-primary-buttons.tsx b/frontend/src/pages/tasks/components/tasks-primary-buttons.tsx deleted file mode 100644 index 106c7eb..0000000 --- a/frontend/src/pages/tasks/components/tasks-primary-buttons.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { IconDownload, IconPlus } from "@tabler/icons-react"; -import { Button } from "@/components/ui/button"; -import { useTasks } from "../context/tasks-context"; - -export function TasksPrimaryButtons() { - const { setOpen } = useTasks(); - return ( -
    - - -
    - ); -} diff --git a/frontend/src/pages/tasks/context/tasks-context.tsx b/frontend/src/pages/tasks/context/tasks-context.tsx deleted file mode 100644 index 590bebf..0000000 --- a/frontend/src/pages/tasks/context/tasks-context.tsx +++ /dev/null @@ -1,39 +0,0 @@ -import React, { useState } from "react"; -import useDialogState from "@/hooks/useDialogState"; -import { Task } from "../data/schema"; - -type TasksDialogType = "create" | "update" | "delete" | "import"; - -interface TasksContextType { - open: TasksDialogType | null; - setOpen: (str: TasksDialogType | null) => void; - currentRow: Task | null; - setCurrentRow: React.Dispatch>; -} - -const TasksContext = React.createContext(null); - -interface Props { - children: React.ReactNode; -} - -export default function TasksProvider({ children }: Props) { - const [open, setOpen] = useDialogState(null); - const [currentRow, setCurrentRow] = useState(null); - return ( - - {children} - - ); -} - -// eslint-disable-next-line react-refresh/only-export-components -export const useTasks = () => { - const tasksContext = React.useContext(TasksContext); - - if (!tasksContext) { - throw new Error("useTasks has to be used within "); - } - - return tasksContext; -}; diff --git a/frontend/src/pages/tasks/data/data.tsx b/frontend/src/pages/tasks/data/data.tsx deleted file mode 100644 index a7ee919..0000000 --- a/frontend/src/pages/tasks/data/data.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { - IconArrowDown, - IconArrowRight, - IconArrowUp, - IconCircle, - IconCircleCheck, - IconCircleX, - IconExclamationCircle, - IconStopwatch, -} from "@tabler/icons-react"; - -export const labels = [ - { - value: "bug", - label: "Bug", - }, - { - value: "feature", - label: "Feature", - }, - { - value: "documentation", - label: "Documentation", - }, -]; - -export const statuses = [ - { - value: "backlog", - label: "Backlog", - icon: IconExclamationCircle, - }, - { - value: "todo", - label: "Todo", - icon: IconCircle, - }, - { - value: "in progress", - label: "In Progress", - icon: IconStopwatch, - }, - { - value: "done", - label: "Done", - icon: IconCircleCheck, - }, - { - value: "canceled", - label: "Canceled", - icon: IconCircleX, - }, -]; - -export const priorities = [ - { - label: "Low", - value: "low", - icon: IconArrowDown, - }, - { - label: "Medium", - value: "medium", - icon: IconArrowRight, - }, - { - label: "High", - value: "high", - icon: IconArrowUp, - }, -]; diff --git a/frontend/src/pages/tasks/data/schema.ts b/frontend/src/pages/tasks/data/schema.ts deleted file mode 100644 index 6a8166e..0000000 --- a/frontend/src/pages/tasks/data/schema.ts +++ /dev/null @@ -1,13 +0,0 @@ -import { z } from "zod"; - -// We're keeping a simple non-relational schema here. -// IRL, you will have a schema for your data models. -export const taskSchema = z.object({ - id: z.string(), - title: z.string(), - status: z.string(), - label: z.string(), - priority: z.string(), -}); - -export type Task = z.infer; diff --git a/frontend/src/pages/tasks/data/tasks.ts b/frontend/src/pages/tasks/data/tasks.ts deleted file mode 100644 index b86ffe1..0000000 --- a/frontend/src/pages/tasks/data/tasks.ts +++ /dev/null @@ -1,782 +0,0 @@ -export const tasks = [ - { - id: "TASK-8782", - title: - "You can't compress the program without quantifying the open-source SSD pixel!", - status: "in progress", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-7878", - title: - "Try to calculate the EXE feed, maybe it will index the multi-byte pixel!", - status: "backlog", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-7839", - title: "We need to bypass the neural TCP card!", - status: "todo", - label: "bug", - priority: "high", - }, - { - id: "TASK-5562", - title: - "The SAS interface is down, bypass the open-source pixel so we can back up the PNG bandwidth!", - status: "backlog", - label: "feature", - priority: "medium", - }, - { - id: "TASK-8686", - title: - "I'll parse the wireless SSL protocol, that should driver the API panel!", - status: "canceled", - label: "feature", - priority: "medium", - }, - { - id: "TASK-1280", - title: - "Use the digital TLS panel, then you can transmit the haptic system!", - status: "done", - label: "bug", - priority: "high", - }, - { - id: "TASK-7262", - title: - "The UTF8 application is down, parse the neural bandwidth so we can back up the PNG firewall!", - status: "done", - label: "feature", - priority: "high", - }, - { - id: "TASK-1138", - title: - "Generating the driver won't do anything, we need to quantify the 1080p SMTP bandwidth!", - status: "in progress", - label: "feature", - priority: "medium", - }, - { - id: "TASK-7184", - title: "We need to program the back-end THX pixel!", - status: "todo", - label: "feature", - priority: "low", - }, - { - id: "TASK-5160", - title: - "Calculating the bus won't do anything, we need to navigate the back-end JSON protocol!", - status: "in progress", - label: "documentation", - priority: "high", - }, - { - id: "TASK-5618", - title: - "Generating the driver won't do anything, we need to index the online SSL application!", - status: "done", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-6699", - title: - "I'll transmit the wireless JBOD capacitor, that should hard drive the SSD feed!", - status: "backlog", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-2858", - title: "We need to override the online UDP bus!", - status: "backlog", - label: "bug", - priority: "medium", - }, - { - id: "TASK-9864", - title: - "I'll reboot the 1080p FTP panel, that should matrix the HEX hard drive!", - status: "done", - label: "bug", - priority: "high", - }, - { - id: "TASK-8404", - title: "We need to generate the virtual HEX alarm!", - status: "in progress", - label: "bug", - priority: "low", - }, - { - id: "TASK-5365", - title: - "Backing up the pixel won't do anything, we need to transmit the primary IB array!", - status: "in progress", - label: "documentation", - priority: "low", - }, - { - id: "TASK-1780", - title: - "The CSS feed is down, index the bluetooth transmitter so we can compress the CLI protocol!", - status: "todo", - label: "documentation", - priority: "high", - }, - { - id: "TASK-6938", - title: - "Use the redundant SCSI application, then you can hack the optical alarm!", - status: "todo", - label: "documentation", - priority: "high", - }, - { - id: "TASK-9885", - title: "We need to compress the auxiliary VGA driver!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-3216", - title: - "Transmitting the transmitter won't do anything, we need to compress the virtual HDD sensor!", - status: "backlog", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-9285", - title: - "The IP monitor is down, copy the haptic alarm so we can generate the HTTP transmitter!", - status: "todo", - label: "bug", - priority: "high", - }, - { - id: "TASK-1024", - title: - "Overriding the microchip won't do anything, we need to transmit the digital OCR transmitter!", - status: "in progress", - label: "documentation", - priority: "low", - }, - { - id: "TASK-7068", - title: - "You can't generate the capacitor without indexing the wireless HEX pixel!", - status: "canceled", - label: "bug", - priority: "low", - }, - { - id: "TASK-6502", - title: - "Navigating the microchip won't do anything, we need to bypass the back-end SQL bus!", - status: "todo", - label: "bug", - priority: "high", - }, - { - id: "TASK-5326", - title: "We need to hack the redundant UTF8 transmitter!", - status: "todo", - label: "bug", - priority: "low", - }, - { - id: "TASK-6274", - title: - "Use the virtual PCI circuit, then you can parse the bluetooth alarm!", - status: "canceled", - label: "documentation", - priority: "low", - }, - { - id: "TASK-1571", - title: - "I'll input the neural DRAM circuit, that should protocol the SMTP interface!", - status: "in progress", - label: "feature", - priority: "medium", - }, - { - id: "TASK-9518", - title: - "Compressing the interface won't do anything, we need to compress the online SDD matrix!", - status: "canceled", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-5581", - title: - "I'll synthesize the digital COM pixel, that should transmitter the UTF8 protocol!", - status: "backlog", - label: "documentation", - priority: "high", - }, - { - id: "TASK-2197", - title: - "Parsing the feed won't do anything, we need to copy the bluetooth DRAM bus!", - status: "todo", - label: "documentation", - priority: "low", - }, - { - id: "TASK-8484", - title: "We need to parse the solid state UDP firewall!", - status: "in progress", - label: "bug", - priority: "low", - }, - { - id: "TASK-9892", - title: - "If we back up the application, we can get to the UDP application through the multi-byte THX capacitor!", - status: "done", - label: "documentation", - priority: "high", - }, - { - id: "TASK-9616", - title: "We need to synthesize the cross-platform ASCII pixel!", - status: "in progress", - label: "feature", - priority: "medium", - }, - { - id: "TASK-9744", - title: - "Use the back-end IP card, then you can input the solid state hard drive!", - status: "done", - label: "documentation", - priority: "low", - }, - { - id: "TASK-1376", - title: - "Generating the alarm won't do anything, we need to generate the mobile IP capacitor!", - status: "backlog", - label: "documentation", - priority: "low", - }, - { - id: "TASK-7382", - title: - "If we back up the firewall, we can get to the RAM alarm through the primary UTF8 pixel!", - status: "todo", - label: "feature", - priority: "low", - }, - { - id: "TASK-2290", - title: - "I'll compress the virtual JSON panel, that should application the UTF8 bus!", - status: "canceled", - label: "documentation", - priority: "high", - }, - { - id: "TASK-1533", - title: - "You can't input the firewall without overriding the wireless TCP firewall!", - status: "done", - label: "bug", - priority: "high", - }, - { - id: "TASK-4920", - title: - "Bypassing the hard drive won't do anything, we need to input the bluetooth JSON program!", - status: "in progress", - label: "bug", - priority: "high", - }, - { - id: "TASK-5168", - title: - "If we synthesize the bus, we can get to the IP panel through the virtual TLS array!", - status: "in progress", - label: "feature", - priority: "low", - }, - { - id: "TASK-7103", - title: "We need to parse the multi-byte EXE bandwidth!", - status: "canceled", - label: "feature", - priority: "low", - }, - { - id: "TASK-4314", - title: - "If we compress the program, we can get to the XML alarm through the multi-byte COM matrix!", - status: "in progress", - label: "bug", - priority: "high", - }, - { - id: "TASK-3415", - title: - "Use the cross-platform XML application, then you can quantify the solid state feed!", - status: "todo", - label: "feature", - priority: "high", - }, - { - id: "TASK-8339", - title: - "Try to calculate the DNS interface, maybe it will input the bluetooth capacitor!", - status: "in progress", - label: "feature", - priority: "low", - }, - { - id: "TASK-6995", - title: - "Try to hack the XSS bandwidth, maybe it will override the bluetooth matrix!", - status: "todo", - label: "feature", - priority: "high", - }, - { - id: "TASK-8053", - title: - "If we connect the program, we can get to the UTF8 matrix through the digital UDP protocol!", - status: "todo", - label: "feature", - priority: "medium", - }, - { - id: "TASK-4336", - title: - "If we synthesize the microchip, we can get to the SAS sensor through the optical UDP program!", - status: "todo", - label: "documentation", - priority: "low", - }, - { - id: "TASK-8790", - title: - "I'll back up the optical COM alarm, that should alarm the RSS capacitor!", - status: "done", - label: "bug", - priority: "medium", - }, - { - id: "TASK-8980", - title: - "Try to navigate the SQL transmitter, maybe it will back up the virtual firewall!", - status: "canceled", - label: "bug", - priority: "low", - }, - { - id: "TASK-7342", - title: "Use the neural CLI card, then you can parse the online port!", - status: "backlog", - label: "documentation", - priority: "low", - }, - { - id: "TASK-5608", - title: - "I'll hack the haptic SSL program, that should bus the UDP transmitter!", - status: "canceled", - label: "documentation", - priority: "low", - }, - { - id: "TASK-1606", - title: - "I'll generate the bluetooth PNG firewall, that should pixel the SSL driver!", - status: "done", - label: "feature", - priority: "medium", - }, - { - id: "TASK-7872", - title: - "Transmitting the circuit won't do anything, we need to reboot the 1080p RSS monitor!", - status: "canceled", - label: "feature", - priority: "medium", - }, - { - id: "TASK-4167", - title: - "Use the cross-platform SMS circuit, then you can synthesize the optical feed!", - status: "canceled", - label: "bug", - priority: "medium", - }, - { - id: "TASK-9581", - title: - "You can't index the port without hacking the cross-platform XSS monitor!", - status: "backlog", - label: "documentation", - priority: "low", - }, - { - id: "TASK-8806", - title: "We need to bypass the back-end SSL panel!", - status: "done", - label: "bug", - priority: "medium", - }, - { - id: "TASK-6542", - title: - "Try to quantify the RSS firewall, maybe it will quantify the open-source system!", - status: "done", - label: "feature", - priority: "low", - }, - { - id: "TASK-6806", - title: - "The VGA protocol is down, reboot the back-end matrix so we can parse the CSS panel!", - status: "canceled", - label: "documentation", - priority: "low", - }, - { - id: "TASK-9549", - title: "You can't bypass the bus without connecting the neural JBOD bus!", - status: "todo", - label: "feature", - priority: "high", - }, - { - id: "TASK-1075", - title: - "Backing up the driver won't do anything, we need to parse the redundant RAM pixel!", - status: "done", - label: "feature", - priority: "medium", - }, - { - id: "TASK-1427", - title: - "Use the auxiliary PCI circuit, then you can calculate the cross-platform interface!", - status: "done", - label: "documentation", - priority: "high", - }, - { - id: "TASK-1907", - title: - "Hacking the circuit won't do anything, we need to back up the online DRAM system!", - status: "todo", - label: "documentation", - priority: "high", - }, - { - id: "TASK-4309", - title: - "If we generate the system, we can get to the TCP sensor through the optical GB pixel!", - status: "backlog", - label: "bug", - priority: "medium", - }, - { - id: "TASK-3973", - title: - "I'll parse the back-end ADP array, that should bandwidth the RSS bandwidth!", - status: "todo", - label: "feature", - priority: "medium", - }, - { - id: "TASK-7962", - title: - "Use the wireless RAM program, then you can hack the cross-platform feed!", - status: "canceled", - label: "bug", - priority: "low", - }, - { - id: "TASK-3360", - title: - "You can't quantify the program without synthesizing the neural OCR interface!", - status: "done", - label: "feature", - priority: "medium", - }, - { - id: "TASK-9887", - title: - "Use the auxiliary ASCII sensor, then you can connect the solid state port!", - status: "backlog", - label: "bug", - priority: "medium", - }, - { - id: "TASK-3649", - title: - "I'll input the virtual USB system, that should circuit the DNS monitor!", - status: "in progress", - label: "feature", - priority: "medium", - }, - { - id: "TASK-3586", - title: - "If we quantify the circuit, we can get to the CLI feed through the mobile SMS hard drive!", - status: "in progress", - label: "bug", - priority: "low", - }, - { - id: "TASK-5150", - title: - "I'll hack the wireless XSS port, that should transmitter the IP interface!", - status: "canceled", - label: "feature", - priority: "medium", - }, - { - id: "TASK-3652", - title: - "The SQL interface is down, override the optical bus so we can program the ASCII interface!", - status: "backlog", - label: "feature", - priority: "low", - }, - { - id: "TASK-6884", - title: - "Use the digital PCI circuit, then you can synthesize the multi-byte microchip!", - status: "canceled", - label: "feature", - priority: "high", - }, - { - id: "TASK-1591", - title: "We need to connect the mobile XSS driver!", - status: "in progress", - label: "feature", - priority: "high", - }, - { - id: "TASK-3802", - title: - "Try to override the ASCII protocol, maybe it will parse the virtual matrix!", - status: "in progress", - label: "feature", - priority: "low", - }, - { - id: "TASK-7253", - title: - "Programming the capacitor won't do anything, we need to bypass the neural IB hard drive!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-9739", - title: "We need to hack the multi-byte HDD bus!", - status: "done", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-4424", - title: - "Try to hack the HEX alarm, maybe it will connect the optical pixel!", - status: "in progress", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-3922", - title: - "You can't back up the capacitor without generating the wireless PCI program!", - status: "backlog", - label: "bug", - priority: "low", - }, - { - id: "TASK-4921", - title: - "I'll index the open-source IP feed, that should system the GB application!", - status: "canceled", - label: "bug", - priority: "low", - }, - { - id: "TASK-5814", - title: "We need to calculate the 1080p AGP feed!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-2645", - title: - "Synthesizing the system won't do anything, we need to navigate the multi-byte HDD firewall!", - status: "todo", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-4535", - title: - "Try to copy the JSON circuit, maybe it will connect the wireless feed!", - status: "in progress", - label: "feature", - priority: "low", - }, - { - id: "TASK-4463", - title: "We need to copy the solid state AGP monitor!", - status: "done", - label: "documentation", - priority: "low", - }, - { - id: "TASK-9745", - title: - "If we connect the protocol, we can get to the GB system through the bluetooth PCI microchip!", - status: "canceled", - label: "feature", - priority: "high", - }, - { - id: "TASK-2080", - title: - "If we input the bus, we can get to the RAM matrix through the auxiliary RAM card!", - status: "todo", - label: "bug", - priority: "medium", - }, - { - id: "TASK-3838", - title: - "I'll bypass the online TCP application, that should panel the AGP system!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-1340", - title: "We need to navigate the virtual PNG circuit!", - status: "todo", - label: "bug", - priority: "medium", - }, - { - id: "TASK-6665", - title: - "If we parse the monitor, we can get to the SSD hard drive through the cross-platform AGP alarm!", - status: "canceled", - label: "feature", - priority: "low", - }, - { - id: "TASK-7585", - title: - "If we calculate the hard drive, we can get to the SSL program through the multi-byte CSS microchip!", - status: "backlog", - label: "feature", - priority: "low", - }, - { - id: "TASK-6319", - title: "We need to copy the multi-byte SCSI program!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-4369", - title: "Try to input the SCSI bus, maybe it will generate the 1080p pixel!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-9035", - title: "We need to override the solid state PNG array!", - status: "canceled", - label: "documentation", - priority: "low", - }, - { - id: "TASK-3970", - title: - "You can't index the transmitter without quantifying the haptic ASCII card!", - status: "todo", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-4473", - title: - "You can't bypass the protocol without overriding the neural RSS program!", - status: "todo", - label: "documentation", - priority: "low", - }, - { - id: "TASK-4136", - title: - "You can't hack the hard drive without hacking the primary JSON program!", - status: "canceled", - label: "bug", - priority: "medium", - }, - { - id: "TASK-3939", - title: - "Use the back-end SQL firewall, then you can connect the neural hard drive!", - status: "done", - label: "feature", - priority: "low", - }, - { - id: "TASK-2007", - title: - "I'll input the back-end USB protocol, that should bandwidth the PCI system!", - status: "backlog", - label: "bug", - priority: "high", - }, - { - id: "TASK-7516", - title: - "Use the primary SQL program, then you can generate the auxiliary transmitter!", - status: "done", - label: "documentation", - priority: "medium", - }, - { - id: "TASK-6906", - title: - "Try to back up the DRAM system, maybe it will reboot the online transmitter!", - status: "done", - label: "feature", - priority: "high", - }, - { - id: "TASK-5207", - title: - "The SMS interface is down, copy the bluetooth bus so we can quantify the VGA card!", - status: "in progress", - label: "bug", - priority: "low", - }, -]; diff --git a/frontend/src/pages/tasks/index.tsx b/frontend/src/pages/tasks/index.tsx deleted file mode 100644 index 79fef75..0000000 --- a/frontend/src/pages/tasks/index.tsx +++ /dev/null @@ -1,42 +0,0 @@ -import { Header } from "@/components/layout/header"; -import { Main } from "@/components/layout/main"; -import { ProfileDropdown } from "@/components/profile-dropdown"; -import { Search } from "@/components/search"; -import { ThemeSwitch } from "@/components/theme-switch"; -import { columns } from "./components/columns"; -import { DataTable } from "./components/data-table"; -import { TasksDialogs } from "./components/tasks-dialogs"; -import { TasksPrimaryButtons } from "./components/tasks-primary-buttons"; -import TasksProvider from "./context/tasks-context"; -import { tasks } from "./data/tasks"; - -export default function Tasks() { - return ( - -
    - -
    - - -
    -
    - -
    -
    -
    -

    Tasks

    -

    - Here's a list of your tasks for this month! -

    -
    - -
    -
    - -
    -
    - - -
    - ); -} diff --git a/frontend/src/pages/users/components/data-table-toolbar.tsx b/frontend/src/pages/users/components/data-table-toolbar.tsx index f0e40ed..eb3d625 100644 --- a/frontend/src/pages/users/components/data-table-toolbar.tsx +++ b/frontend/src/pages/users/components/data-table-toolbar.tsx @@ -29,18 +29,6 @@ export function DataTableToolbar({ className="h-8 w-[150px] lg:w-[250px]" />
    - {table.getColumn("status") && ( - - )} {table.getColumn("role") && ( - diff --git a/frontend/src/routeTree.gen.ts b/frontend/src/routeTree.gen.ts index 1d24740..4a21cc1 100644 --- a/frontend/src/routeTree.gen.ts +++ b/frontend/src/routeTree.gen.ts @@ -8,847 +8,727 @@ // You should NOT make any changes in this file as it will be overwritten. // Additionally, you should also exclude this file from your linter and/or formatter to prevent it from being checked or modified. -import { createFileRoute } from "@tanstack/react-router"; +import { createFileRoute } from '@tanstack/react-router' // Import Routes -import { Route as rootRoute } from "./routes/__root"; -import { Route as AuthenticatedRouteImport } from "./routes/_authenticated/route"; -import { Route as IndexImport } from "./routes/index"; -import { Route as authSignInImport } from "./routes/(auth)/sign-in"; -import { Route as authOtpImport } from "./routes/(auth)/otp"; -import { Route as auth500Import } from "./routes/(auth)/500"; -import { Route as AuthenticatedDashboardIndexImport } from "./routes/_authenticated/dashboard/index"; +import { Route as rootRoute } from './routes/__root' +import { Route as AuthenticatedRouteImport } from './routes/_authenticated/route' +import { Route as IndexImport } from './routes/index' +import { Route as authSignInImport } from './routes/(auth)/sign-in' +import { Route as authOtpImport } from './routes/(auth)/otp' +import { Route as auth500Import } from './routes/(auth)/500' +import { Route as AuthenticatedDashboardIndexImport } from './routes/_authenticated/dashboard/index' // Create Virtual Routes -const errors503LazyImport = createFileRoute("/(errors)/503")(); -const errors500LazyImport = createFileRoute("/(errors)/500")(); -const errors404LazyImport = createFileRoute("/(errors)/404")(); -const errors403LazyImport = createFileRoute("/(errors)/403")(); -const errors401LazyImport = createFileRoute("/(errors)/401")(); -const authSignUpLazyImport = createFileRoute("/(auth)/sign-up")(); -const authSignIn2LazyImport = createFileRoute("/(auth)/sign-in-2")(); +const errors503LazyImport = createFileRoute('/(errors)/503')() +const errors500LazyImport = createFileRoute('/(errors)/500')() +const errors404LazyImport = createFileRoute('/(errors)/404')() +const errors403LazyImport = createFileRoute('/(errors)/403')() +const errors401LazyImport = createFileRoute('/(errors)/401')() +const authSignUpLazyImport = createFileRoute('/(auth)/sign-up')() +const authSignIn2LazyImport = createFileRoute('/(auth)/sign-in-2')() const authForgotPasswordLazyImport = createFileRoute( - "/(auth)/forgot-password", -)(); + '/(auth)/forgot-password', +)() const AuthenticatedHelpCenterIndexLazyImport = createFileRoute( - "/_authenticated/help-center/", -)(); + '/_authenticated/help-center/', +)() const AuthenticatedDashboardSettingsRouteLazyImport = createFileRoute( - "/_authenticated/dashboard/settings", -)(); + '/_authenticated/dashboard/settings', +)() const AuthenticatedDashboardUsersIndexLazyImport = createFileRoute( - "/_authenticated/dashboard/users/", -)(); -const AuthenticatedDashboardTasksIndexLazyImport = createFileRoute( - "/_authenticated/dashboard/tasks/", -)(); + '/_authenticated/dashboard/users/', +)() const AuthenticatedDashboardShopIndexLazyImport = createFileRoute( - "/_authenticated/dashboard/shop/", -)(); + '/_authenticated/dashboard/shop/', +)() const AuthenticatedDashboardSettingsIndexLazyImport = createFileRoute( - "/_authenticated/dashboard/settings/", -)(); + '/_authenticated/dashboard/settings/', +)() const AuthenticatedDashboardProductsIndexLazyImport = createFileRoute( - "/_authenticated/dashboard/products/", -)(); + '/_authenticated/dashboard/products/', +)() +const AuthenticatedDashboardMockIndexLazyImport = createFileRoute( + '/_authenticated/dashboard/mock/', +)() const AuthenticatedDashboardChatsIndexLazyImport = createFileRoute( - "/_authenticated/dashboard/chats/", -)(); -const AuthenticatedDashboardSettingsSecurityLazyImport = createFileRoute( - "/_authenticated/dashboard/settings/security", -)(); -const AuthenticatedDashboardSettingsNotificationsLazyImport = createFileRoute( - "/_authenticated/dashboard/settings/notifications", -)(); -const AuthenticatedDashboardSettingsDisplayLazyImport = createFileRoute( - "/_authenticated/dashboard/settings/display", -)(); + '/_authenticated/dashboard/chats/', +)() const AuthenticatedDashboardSettingsAppearanceLazyImport = createFileRoute( - "/_authenticated/dashboard/settings/appearance", -)(); -const AuthenticatedDashboardSettingsAccountLazyImport = createFileRoute( - "/_authenticated/dashboard/settings/account", -)(); + '/_authenticated/dashboard/settings/appearance', +)() const AuthenticatedDashboardSalesRecentSalesLazyImport = createFileRoute( - "/_authenticated/dashboard/sales/recent-sales", -)(); + '/_authenticated/dashboard/sales/recent-sales', +)() const AuthenticatedDashboardSalesCouponsLazyImport = createFileRoute( - "/_authenticated/dashboard/sales/coupons", -)(); + '/_authenticated/dashboard/sales/coupons', +)() // Create/Update Routes const AuthenticatedRouteRoute = AuthenticatedRouteImport.update({ - id: "/_authenticated", - getParentRoute: () => rootRoute, -} as any); + id: '/_authenticated', + getParentRoute: () => rootRoute, +} as any) const IndexRoute = IndexImport.update({ - id: "/", - path: "/", - getParentRoute: () => rootRoute, -} as any); + id: '/', + path: '/', + getParentRoute: () => rootRoute, +} as any) const errors503LazyRoute = errors503LazyImport - .update({ - id: "/(errors)/503", - path: "/503", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(errors)/503.lazy").then((d) => d.Route)); + .update({ + id: '/(errors)/503', + path: '/503', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(errors)/503.lazy').then((d) => d.Route)) const errors500LazyRoute = errors500LazyImport - .update({ - id: "/(errors)/500", - path: "/500", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(errors)/500.lazy").then((d) => d.Route)); + .update({ + id: '/(errors)/500', + path: '/500', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(errors)/500.lazy').then((d) => d.Route)) const errors404LazyRoute = errors404LazyImport - .update({ - id: "/(errors)/404", - path: "/404", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(errors)/404.lazy").then((d) => d.Route)); + .update({ + id: '/(errors)/404', + path: '/404', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(errors)/404.lazy').then((d) => d.Route)) const errors403LazyRoute = errors403LazyImport - .update({ - id: "/(errors)/403", - path: "/403", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(errors)/403.lazy").then((d) => d.Route)); + .update({ + id: '/(errors)/403', + path: '/403', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(errors)/403.lazy').then((d) => d.Route)) const errors401LazyRoute = errors401LazyImport - .update({ - id: "/(errors)/401", - path: "/401", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(errors)/401.lazy").then((d) => d.Route)); + .update({ + id: '/(errors)/401', + path: '/401', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(errors)/401.lazy').then((d) => d.Route)) const authSignUpLazyRoute = authSignUpLazyImport - .update({ - id: "/(auth)/sign-up", - path: "/sign-up", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(auth)/sign-up.lazy").then((d) => d.Route)); + .update({ + id: '/(auth)/sign-up', + path: '/sign-up', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(auth)/sign-up.lazy').then((d) => d.Route)) const authSignIn2LazyRoute = authSignIn2LazyImport - .update({ - id: "/(auth)/sign-in-2", - path: "/sign-in-2", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => import("./routes/(auth)/sign-in-2.lazy").then((d) => d.Route)); + .update({ + id: '/(auth)/sign-in-2', + path: '/sign-in-2', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => import('./routes/(auth)/sign-in-2.lazy').then((d) => d.Route)) const authForgotPasswordLazyRoute = authForgotPasswordLazyImport - .update({ - id: "/(auth)/forgot-password", - path: "/forgot-password", - getParentRoute: () => rootRoute, - } as any) - .lazy(() => - import("./routes/(auth)/forgot-password.lazy").then((d) => d.Route), - ); + .update({ + id: '/(auth)/forgot-password', + path: '/forgot-password', + getParentRoute: () => rootRoute, + } as any) + .lazy(() => + import('./routes/(auth)/forgot-password.lazy').then((d) => d.Route), + ) const authSignInRoute = authSignInImport.update({ - id: "/(auth)/sign-in", - path: "/sign-in", - getParentRoute: () => rootRoute, -} as any); + id: '/(auth)/sign-in', + path: '/sign-in', + getParentRoute: () => rootRoute, +} as any) const authOtpRoute = authOtpImport.update({ - id: "/(auth)/otp", - path: "/otp", - getParentRoute: () => rootRoute, -} as any); + id: '/(auth)/otp', + path: '/otp', + getParentRoute: () => rootRoute, +} as any) const auth500Route = auth500Import.update({ - id: "/(auth)/500", - path: "/500", - getParentRoute: () => rootRoute, -} as any); + id: '/(auth)/500', + path: '/500', + getParentRoute: () => rootRoute, +} as any) const AuthenticatedHelpCenterIndexLazyRoute = - AuthenticatedHelpCenterIndexLazyImport.update({ - id: "/help-center/", - path: "/help-center/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/help-center/index.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedHelpCenterIndexLazyImport.update({ + id: '/help-center/', + path: '/help-center/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/help-center/index.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardIndexRoute = - AuthenticatedDashboardIndexImport.update({ - id: "/dashboard/", - path: "/dashboard/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any); + AuthenticatedDashboardIndexImport.update({ + id: '/dashboard/', + path: '/dashboard/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any) const AuthenticatedDashboardSettingsRouteLazyRoute = - AuthenticatedDashboardSettingsRouteLazyImport.update({ - id: "/dashboard/settings", - path: "/dashboard/settings", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/settings/route.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardSettingsRouteLazyImport.update({ + id: '/dashboard/settings', + path: '/dashboard/settings', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/settings/route.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardUsersIndexLazyRoute = - AuthenticatedDashboardUsersIndexLazyImport.update({ - id: "/dashboard/users/", - path: "/dashboard/users/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/users/index.lazy").then( - (d) => d.Route, - ), - ); - -const AuthenticatedDashboardTasksIndexLazyRoute = - AuthenticatedDashboardTasksIndexLazyImport.update({ - id: "/dashboard/tasks/", - path: "/dashboard/tasks/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/tasks/index.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardUsersIndexLazyImport.update({ + id: '/dashboard/users/', + path: '/dashboard/users/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/users/index.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardShopIndexLazyRoute = - AuthenticatedDashboardShopIndexLazyImport.update({ - id: "/dashboard/shop/", - path: "/dashboard/shop/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/shop/index.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardShopIndexLazyImport.update({ + id: '/dashboard/shop/', + path: '/dashboard/shop/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/shop/index.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardSettingsIndexLazyRoute = - AuthenticatedDashboardSettingsIndexLazyImport.update({ - id: "/", - path: "/", - getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/settings/index.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardSettingsIndexLazyImport.update({ + id: '/', + path: '/', + getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/settings/index.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardProductsIndexLazyRoute = - AuthenticatedDashboardProductsIndexLazyImport.update({ - id: "/dashboard/products/", - path: "/dashboard/products/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/products/index.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardProductsIndexLazyImport.update({ + id: '/dashboard/products/', + path: '/dashboard/products/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/products/index.lazy').then( + (d) => d.Route, + ), + ) + +const AuthenticatedDashboardMockIndexLazyRoute = + AuthenticatedDashboardMockIndexLazyImport.update({ + id: '/dashboard/mock/', + path: '/dashboard/mock/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/mock/index.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardChatsIndexLazyRoute = - AuthenticatedDashboardChatsIndexLazyImport.update({ - id: "/dashboard/chats/", - path: "/dashboard/chats/", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/chats/index.lazy").then( - (d) => d.Route, - ), - ); - -const AuthenticatedDashboardSettingsSecurityLazyRoute = - AuthenticatedDashboardSettingsSecurityLazyImport.update({ - id: "/security", - path: "/security", - getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/settings/security.lazy").then( - (d) => d.Route, - ), - ); - -const AuthenticatedDashboardSettingsNotificationsLazyRoute = - AuthenticatedDashboardSettingsNotificationsLazyImport.update({ - id: "/notifications", - path: "/notifications", - getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, - } as any).lazy(() => - import( - "./routes/_authenticated/dashboard/settings/notifications.lazy" - ).then((d) => d.Route), - ); - -const AuthenticatedDashboardSettingsDisplayLazyRoute = - AuthenticatedDashboardSettingsDisplayLazyImport.update({ - id: "/display", - path: "/display", - getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/settings/display.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardChatsIndexLazyImport.update({ + id: '/dashboard/chats/', + path: '/dashboard/chats/', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/chats/index.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardSettingsAppearanceLazyRoute = - AuthenticatedDashboardSettingsAppearanceLazyImport.update({ - id: "/appearance", - path: "/appearance", - getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/settings/appearance.lazy").then( - (d) => d.Route, - ), - ); - -const AuthenticatedDashboardSettingsAccountLazyRoute = - AuthenticatedDashboardSettingsAccountLazyImport.update({ - id: "/account", - path: "/account", - getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/settings/account.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardSettingsAppearanceLazyImport.update({ + id: '/appearance', + path: '/appearance', + getParentRoute: () => AuthenticatedDashboardSettingsRouteLazyRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/settings/appearance.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardSalesRecentSalesLazyRoute = - AuthenticatedDashboardSalesRecentSalesLazyImport.update({ - id: "/dashboard/sales/recent-sales", - path: "/dashboard/sales/recent-sales", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/sales/recent-sales.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardSalesRecentSalesLazyImport.update({ + id: '/dashboard/sales/recent-sales', + path: '/dashboard/sales/recent-sales', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/sales/recent-sales.lazy').then( + (d) => d.Route, + ), + ) const AuthenticatedDashboardSalesCouponsLazyRoute = - AuthenticatedDashboardSalesCouponsLazyImport.update({ - id: "/dashboard/sales/coupons", - path: "/dashboard/sales/coupons", - getParentRoute: () => AuthenticatedRouteRoute, - } as any).lazy(() => - import("./routes/_authenticated/dashboard/sales/coupons.lazy").then( - (d) => d.Route, - ), - ); + AuthenticatedDashboardSalesCouponsLazyImport.update({ + id: '/dashboard/sales/coupons', + path: '/dashboard/sales/coupons', + getParentRoute: () => AuthenticatedRouteRoute, + } as any).lazy(() => + import('./routes/_authenticated/dashboard/sales/coupons.lazy').then( + (d) => d.Route, + ), + ) // Populate the FileRoutesByPath interface -declare module "@tanstack/react-router" { - interface FileRoutesByPath { - "/": { - id: "/"; - path: "/"; - fullPath: "/"; - preLoaderRoute: typeof IndexImport; - parentRoute: typeof rootRoute; - }; - "/_authenticated": { - id: "/_authenticated"; - path: ""; - fullPath: ""; - preLoaderRoute: typeof AuthenticatedRouteImport; - parentRoute: typeof rootRoute; - }; - "/(auth)/500": { - id: "/(auth)/500"; - path: "/500"; - fullPath: "/500"; - preLoaderRoute: typeof auth500Import; - parentRoute: typeof rootRoute; - }; - "/(auth)/otp": { - id: "/(auth)/otp"; - path: "/otp"; - fullPath: "/otp"; - preLoaderRoute: typeof authOtpImport; - parentRoute: typeof rootRoute; - }; - "/(auth)/sign-in": { - id: "/(auth)/sign-in"; - path: "/sign-in"; - fullPath: "/sign-in"; - preLoaderRoute: typeof authSignInImport; - parentRoute: typeof rootRoute; - }; - "/(auth)/forgot-password": { - id: "/(auth)/forgot-password"; - path: "/forgot-password"; - fullPath: "/forgot-password"; - preLoaderRoute: typeof authForgotPasswordLazyImport; - parentRoute: typeof rootRoute; - }; - "/(auth)/sign-in-2": { - id: "/(auth)/sign-in-2"; - path: "/sign-in-2"; - fullPath: "/sign-in-2"; - preLoaderRoute: typeof authSignIn2LazyImport; - parentRoute: typeof rootRoute; - }; - "/(auth)/sign-up": { - id: "/(auth)/sign-up"; - path: "/sign-up"; - fullPath: "/sign-up"; - preLoaderRoute: typeof authSignUpLazyImport; - parentRoute: typeof rootRoute; - }; - "/(errors)/401": { - id: "/(errors)/401"; - path: "/401"; - fullPath: "/401"; - preLoaderRoute: typeof errors401LazyImport; - parentRoute: typeof rootRoute; - }; - "/(errors)/403": { - id: "/(errors)/403"; - path: "/403"; - fullPath: "/403"; - preLoaderRoute: typeof errors403LazyImport; - parentRoute: typeof rootRoute; - }; - "/(errors)/404": { - id: "/(errors)/404"; - path: "/404"; - fullPath: "/404"; - preLoaderRoute: typeof errors404LazyImport; - parentRoute: typeof rootRoute; - }; - "/(errors)/500": { - id: "/(errors)/500"; - path: "/500"; - fullPath: "/500"; - preLoaderRoute: typeof errors500LazyImport; - parentRoute: typeof rootRoute; - }; - "/(errors)/503": { - id: "/(errors)/503"; - path: "/503"; - fullPath: "/503"; - preLoaderRoute: typeof errors503LazyImport; - parentRoute: typeof rootRoute; - }; - "/_authenticated/dashboard/settings": { - id: "/_authenticated/dashboard/settings"; - path: "/dashboard/settings"; - fullPath: "/dashboard/settings"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/": { - id: "/_authenticated/dashboard/"; - path: "/dashboard"; - fullPath: "/dashboard"; - preLoaderRoute: typeof AuthenticatedDashboardIndexImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/help-center/": { - id: "/_authenticated/help-center/"; - path: "/help-center"; - fullPath: "/help-center"; - preLoaderRoute: typeof AuthenticatedHelpCenterIndexLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/sales/coupons": { - id: "/_authenticated/dashboard/sales/coupons"; - path: "/dashboard/sales/coupons"; - fullPath: "/dashboard/sales/coupons"; - preLoaderRoute: typeof AuthenticatedDashboardSalesCouponsLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/sales/recent-sales": { - id: "/_authenticated/dashboard/sales/recent-sales"; - path: "/dashboard/sales/recent-sales"; - fullPath: "/dashboard/sales/recent-sales"; - preLoaderRoute: typeof AuthenticatedDashboardSalesRecentSalesLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/settings/account": { - id: "/_authenticated/dashboard/settings/account"; - path: "/account"; - fullPath: "/dashboard/settings/account"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsAccountLazyImport; - parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - }; - "/_authenticated/dashboard/settings/appearance": { - id: "/_authenticated/dashboard/settings/appearance"; - path: "/appearance"; - fullPath: "/dashboard/settings/appearance"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsAppearanceLazyImport; - parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - }; - "/_authenticated/dashboard/settings/display": { - id: "/_authenticated/dashboard/settings/display"; - path: "/display"; - fullPath: "/dashboard/settings/display"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsDisplayLazyImport; - parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - }; - "/_authenticated/dashboard/settings/notifications": { - id: "/_authenticated/dashboard/settings/notifications"; - path: "/notifications"; - fullPath: "/dashboard/settings/notifications"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsNotificationsLazyImport; - parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - }; - "/_authenticated/dashboard/settings/security": { - id: "/_authenticated/dashboard/settings/security"; - path: "/security"; - fullPath: "/dashboard/settings/security"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsSecurityLazyImport; - parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - }; - "/_authenticated/dashboard/chats/": { - id: "/_authenticated/dashboard/chats/"; - path: "/dashboard/chats"; - fullPath: "/dashboard/chats"; - preLoaderRoute: typeof AuthenticatedDashboardChatsIndexLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/products/": { - id: "/_authenticated/dashboard/products/"; - path: "/dashboard/products"; - fullPath: "/dashboard/products"; - preLoaderRoute: typeof AuthenticatedDashboardProductsIndexLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/settings/": { - id: "/_authenticated/dashboard/settings/"; - path: "/"; - fullPath: "/dashboard/settings/"; - preLoaderRoute: typeof AuthenticatedDashboardSettingsIndexLazyImport; - parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport; - }; - "/_authenticated/dashboard/shop/": { - id: "/_authenticated/dashboard/shop/"; - path: "/dashboard/shop"; - fullPath: "/dashboard/shop"; - preLoaderRoute: typeof AuthenticatedDashboardShopIndexLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/tasks/": { - id: "/_authenticated/dashboard/tasks/"; - path: "/dashboard/tasks"; - fullPath: "/dashboard/tasks"; - preLoaderRoute: typeof AuthenticatedDashboardTasksIndexLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - "/_authenticated/dashboard/users/": { - id: "/_authenticated/dashboard/users/"; - path: "/dashboard/users"; - fullPath: "/dashboard/users"; - preLoaderRoute: typeof AuthenticatedDashboardUsersIndexLazyImport; - parentRoute: typeof AuthenticatedRouteImport; - }; - } +declare module '@tanstack/react-router' { + interface FileRoutesByPath { + '/': { + id: '/' + path: '/' + fullPath: '/' + preLoaderRoute: typeof IndexImport + parentRoute: typeof rootRoute + } + '/_authenticated': { + id: '/_authenticated' + path: '' + fullPath: '' + preLoaderRoute: typeof AuthenticatedRouteImport + parentRoute: typeof rootRoute + } + '/(auth)/500': { + id: '/(auth)/500' + path: '/500' + fullPath: '/500' + preLoaderRoute: typeof auth500Import + parentRoute: typeof rootRoute + } + '/(auth)/otp': { + id: '/(auth)/otp' + path: '/otp' + fullPath: '/otp' + preLoaderRoute: typeof authOtpImport + parentRoute: typeof rootRoute + } + '/(auth)/sign-in': { + id: '/(auth)/sign-in' + path: '/sign-in' + fullPath: '/sign-in' + preLoaderRoute: typeof authSignInImport + parentRoute: typeof rootRoute + } + '/(auth)/forgot-password': { + id: '/(auth)/forgot-password' + path: '/forgot-password' + fullPath: '/forgot-password' + preLoaderRoute: typeof authForgotPasswordLazyImport + parentRoute: typeof rootRoute + } + '/(auth)/sign-in-2': { + id: '/(auth)/sign-in-2' + path: '/sign-in-2' + fullPath: '/sign-in-2' + preLoaderRoute: typeof authSignIn2LazyImport + parentRoute: typeof rootRoute + } + '/(auth)/sign-up': { + id: '/(auth)/sign-up' + path: '/sign-up' + fullPath: '/sign-up' + preLoaderRoute: typeof authSignUpLazyImport + parentRoute: typeof rootRoute + } + '/(errors)/401': { + id: '/(errors)/401' + path: '/401' + fullPath: '/401' + preLoaderRoute: typeof errors401LazyImport + parentRoute: typeof rootRoute + } + '/(errors)/403': { + id: '/(errors)/403' + path: '/403' + fullPath: '/403' + preLoaderRoute: typeof errors403LazyImport + parentRoute: typeof rootRoute + } + '/(errors)/404': { + id: '/(errors)/404' + path: '/404' + fullPath: '/404' + preLoaderRoute: typeof errors404LazyImport + parentRoute: typeof rootRoute + } + '/(errors)/500': { + id: '/(errors)/500' + path: '/500' + fullPath: '/500' + preLoaderRoute: typeof errors500LazyImport + parentRoute: typeof rootRoute + } + '/(errors)/503': { + id: '/(errors)/503' + path: '/503' + fullPath: '/503' + preLoaderRoute: typeof errors503LazyImport + parentRoute: typeof rootRoute + } + '/_authenticated/dashboard/settings': { + id: '/_authenticated/dashboard/settings' + path: '/dashboard/settings' + fullPath: '/dashboard/settings' + preLoaderRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/': { + id: '/_authenticated/dashboard/' + path: '/dashboard' + fullPath: '/dashboard' + preLoaderRoute: typeof AuthenticatedDashboardIndexImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/help-center/': { + id: '/_authenticated/help-center/' + path: '/help-center' + fullPath: '/help-center' + preLoaderRoute: typeof AuthenticatedHelpCenterIndexLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/sales/coupons': { + id: '/_authenticated/dashboard/sales/coupons' + path: '/dashboard/sales/coupons' + fullPath: '/dashboard/sales/coupons' + preLoaderRoute: typeof AuthenticatedDashboardSalesCouponsLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/sales/recent-sales': { + id: '/_authenticated/dashboard/sales/recent-sales' + path: '/dashboard/sales/recent-sales' + fullPath: '/dashboard/sales/recent-sales' + preLoaderRoute: typeof AuthenticatedDashboardSalesRecentSalesLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/settings/appearance': { + id: '/_authenticated/dashboard/settings/appearance' + path: '/appearance' + fullPath: '/dashboard/settings/appearance' + preLoaderRoute: typeof AuthenticatedDashboardSettingsAppearanceLazyImport + parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport + } + '/_authenticated/dashboard/chats/': { + id: '/_authenticated/dashboard/chats/' + path: '/dashboard/chats' + fullPath: '/dashboard/chats' + preLoaderRoute: typeof AuthenticatedDashboardChatsIndexLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/mock/': { + id: '/_authenticated/dashboard/mock/' + path: '/dashboard/mock' + fullPath: '/dashboard/mock' + preLoaderRoute: typeof AuthenticatedDashboardMockIndexLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/products/': { + id: '/_authenticated/dashboard/products/' + path: '/dashboard/products' + fullPath: '/dashboard/products' + preLoaderRoute: typeof AuthenticatedDashboardProductsIndexLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/settings/': { + id: '/_authenticated/dashboard/settings/' + path: '/' + fullPath: '/dashboard/settings/' + preLoaderRoute: typeof AuthenticatedDashboardSettingsIndexLazyImport + parentRoute: typeof AuthenticatedDashboardSettingsRouteLazyImport + } + '/_authenticated/dashboard/shop/': { + id: '/_authenticated/dashboard/shop/' + path: '/dashboard/shop' + fullPath: '/dashboard/shop' + preLoaderRoute: typeof AuthenticatedDashboardShopIndexLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + '/_authenticated/dashboard/users/': { + id: '/_authenticated/dashboard/users/' + path: '/dashboard/users' + fullPath: '/dashboard/users' + preLoaderRoute: typeof AuthenticatedDashboardUsersIndexLazyImport + parentRoute: typeof AuthenticatedRouteImport + } + } } // Create and export the route tree interface AuthenticatedDashboardSettingsRouteLazyRouteChildren { - AuthenticatedDashboardSettingsAccountLazyRoute: typeof AuthenticatedDashboardSettingsAccountLazyRoute; - AuthenticatedDashboardSettingsAppearanceLazyRoute: typeof AuthenticatedDashboardSettingsAppearanceLazyRoute; - AuthenticatedDashboardSettingsDisplayLazyRoute: typeof AuthenticatedDashboardSettingsDisplayLazyRoute; - AuthenticatedDashboardSettingsNotificationsLazyRoute: typeof AuthenticatedDashboardSettingsNotificationsLazyRoute; - AuthenticatedDashboardSettingsSecurityLazyRoute: typeof AuthenticatedDashboardSettingsSecurityLazyRoute; - AuthenticatedDashboardSettingsIndexLazyRoute: typeof AuthenticatedDashboardSettingsIndexLazyRoute; + AuthenticatedDashboardSettingsAppearanceLazyRoute: typeof AuthenticatedDashboardSettingsAppearanceLazyRoute + AuthenticatedDashboardSettingsIndexLazyRoute: typeof AuthenticatedDashboardSettingsIndexLazyRoute } const AuthenticatedDashboardSettingsRouteLazyRouteChildren: AuthenticatedDashboardSettingsRouteLazyRouteChildren = - { - AuthenticatedDashboardSettingsAccountLazyRoute: - AuthenticatedDashboardSettingsAccountLazyRoute, - AuthenticatedDashboardSettingsAppearanceLazyRoute: - AuthenticatedDashboardSettingsAppearanceLazyRoute, - AuthenticatedDashboardSettingsDisplayLazyRoute: - AuthenticatedDashboardSettingsDisplayLazyRoute, - AuthenticatedDashboardSettingsNotificationsLazyRoute: - AuthenticatedDashboardSettingsNotificationsLazyRoute, - AuthenticatedDashboardSettingsSecurityLazyRoute: - AuthenticatedDashboardSettingsSecurityLazyRoute, - AuthenticatedDashboardSettingsIndexLazyRoute: - AuthenticatedDashboardSettingsIndexLazyRoute, - }; + { + AuthenticatedDashboardSettingsAppearanceLazyRoute: + AuthenticatedDashboardSettingsAppearanceLazyRoute, + AuthenticatedDashboardSettingsIndexLazyRoute: + AuthenticatedDashboardSettingsIndexLazyRoute, + } const AuthenticatedDashboardSettingsRouteLazyRouteWithChildren = - AuthenticatedDashboardSettingsRouteLazyRoute._addFileChildren( - AuthenticatedDashboardSettingsRouteLazyRouteChildren, - ); + AuthenticatedDashboardSettingsRouteLazyRoute._addFileChildren( + AuthenticatedDashboardSettingsRouteLazyRouteChildren, + ) interface AuthenticatedRouteRouteChildren { - AuthenticatedDashboardSettingsRouteLazyRoute: typeof AuthenticatedDashboardSettingsRouteLazyRouteWithChildren; - AuthenticatedDashboardIndexRoute: typeof AuthenticatedDashboardIndexRoute; - AuthenticatedHelpCenterIndexLazyRoute: typeof AuthenticatedHelpCenterIndexLazyRoute; - AuthenticatedDashboardSalesCouponsLazyRoute: typeof AuthenticatedDashboardSalesCouponsLazyRoute; - AuthenticatedDashboardSalesRecentSalesLazyRoute: typeof AuthenticatedDashboardSalesRecentSalesLazyRoute; - AuthenticatedDashboardChatsIndexLazyRoute: typeof AuthenticatedDashboardChatsIndexLazyRoute; - AuthenticatedDashboardProductsIndexLazyRoute: typeof AuthenticatedDashboardProductsIndexLazyRoute; - AuthenticatedDashboardShopIndexLazyRoute: typeof AuthenticatedDashboardShopIndexLazyRoute; - AuthenticatedDashboardTasksIndexLazyRoute: typeof AuthenticatedDashboardTasksIndexLazyRoute; - AuthenticatedDashboardUsersIndexLazyRoute: typeof AuthenticatedDashboardUsersIndexLazyRoute; + AuthenticatedDashboardSettingsRouteLazyRoute: typeof AuthenticatedDashboardSettingsRouteLazyRouteWithChildren + AuthenticatedDashboardIndexRoute: typeof AuthenticatedDashboardIndexRoute + AuthenticatedHelpCenterIndexLazyRoute: typeof AuthenticatedHelpCenterIndexLazyRoute + AuthenticatedDashboardSalesCouponsLazyRoute: typeof AuthenticatedDashboardSalesCouponsLazyRoute + AuthenticatedDashboardSalesRecentSalesLazyRoute: typeof AuthenticatedDashboardSalesRecentSalesLazyRoute + AuthenticatedDashboardChatsIndexLazyRoute: typeof AuthenticatedDashboardChatsIndexLazyRoute + AuthenticatedDashboardMockIndexLazyRoute: typeof AuthenticatedDashboardMockIndexLazyRoute + AuthenticatedDashboardProductsIndexLazyRoute: typeof AuthenticatedDashboardProductsIndexLazyRoute + AuthenticatedDashboardShopIndexLazyRoute: typeof AuthenticatedDashboardShopIndexLazyRoute + AuthenticatedDashboardUsersIndexLazyRoute: typeof AuthenticatedDashboardUsersIndexLazyRoute } const AuthenticatedRouteRouteChildren: AuthenticatedRouteRouteChildren = { - AuthenticatedDashboardSettingsRouteLazyRoute: - AuthenticatedDashboardSettingsRouteLazyRouteWithChildren, - AuthenticatedDashboardIndexRoute: AuthenticatedDashboardIndexRoute, - AuthenticatedHelpCenterIndexLazyRoute: AuthenticatedHelpCenterIndexLazyRoute, - AuthenticatedDashboardSalesCouponsLazyRoute: - AuthenticatedDashboardSalesCouponsLazyRoute, - AuthenticatedDashboardSalesRecentSalesLazyRoute: - AuthenticatedDashboardSalesRecentSalesLazyRoute, - AuthenticatedDashboardChatsIndexLazyRoute: - AuthenticatedDashboardChatsIndexLazyRoute, - AuthenticatedDashboardProductsIndexLazyRoute: - AuthenticatedDashboardProductsIndexLazyRoute, - AuthenticatedDashboardShopIndexLazyRoute: - AuthenticatedDashboardShopIndexLazyRoute, - AuthenticatedDashboardTasksIndexLazyRoute: - AuthenticatedDashboardTasksIndexLazyRoute, - AuthenticatedDashboardUsersIndexLazyRoute: - AuthenticatedDashboardUsersIndexLazyRoute, -}; + AuthenticatedDashboardSettingsRouteLazyRoute: + AuthenticatedDashboardSettingsRouteLazyRouteWithChildren, + AuthenticatedDashboardIndexRoute: AuthenticatedDashboardIndexRoute, + AuthenticatedHelpCenterIndexLazyRoute: AuthenticatedHelpCenterIndexLazyRoute, + AuthenticatedDashboardSalesCouponsLazyRoute: + AuthenticatedDashboardSalesCouponsLazyRoute, + AuthenticatedDashboardSalesRecentSalesLazyRoute: + AuthenticatedDashboardSalesRecentSalesLazyRoute, + AuthenticatedDashboardChatsIndexLazyRoute: + AuthenticatedDashboardChatsIndexLazyRoute, + AuthenticatedDashboardMockIndexLazyRoute: + AuthenticatedDashboardMockIndexLazyRoute, + AuthenticatedDashboardProductsIndexLazyRoute: + AuthenticatedDashboardProductsIndexLazyRoute, + AuthenticatedDashboardShopIndexLazyRoute: + AuthenticatedDashboardShopIndexLazyRoute, + AuthenticatedDashboardUsersIndexLazyRoute: + AuthenticatedDashboardUsersIndexLazyRoute, +} const AuthenticatedRouteRouteWithChildren = - AuthenticatedRouteRoute._addFileChildren(AuthenticatedRouteRouteChildren); + AuthenticatedRouteRoute._addFileChildren(AuthenticatedRouteRouteChildren) export interface FileRoutesByFullPath { - "/": typeof IndexRoute; - "": typeof AuthenticatedRouteRouteWithChildren; - "/500": typeof errors500LazyRoute; - "/otp": typeof authOtpRoute; - "/sign-in": typeof authSignInRoute; - "/forgot-password": typeof authForgotPasswordLazyRoute; - "/sign-in-2": typeof authSignIn2LazyRoute; - "/sign-up": typeof authSignUpLazyRoute; - "/401": typeof errors401LazyRoute; - "/403": typeof errors403LazyRoute; - "/404": typeof errors404LazyRoute; - "/503": typeof errors503LazyRoute; - "/dashboard/settings": typeof AuthenticatedDashboardSettingsRouteLazyRouteWithChildren; - "/dashboard": typeof AuthenticatedDashboardIndexRoute; - "/help-center": typeof AuthenticatedHelpCenterIndexLazyRoute; - "/dashboard/sales/coupons": typeof AuthenticatedDashboardSalesCouponsLazyRoute; - "/dashboard/sales/recent-sales": typeof AuthenticatedDashboardSalesRecentSalesLazyRoute; - "/dashboard/settings/account": typeof AuthenticatedDashboardSettingsAccountLazyRoute; - "/dashboard/settings/appearance": typeof AuthenticatedDashboardSettingsAppearanceLazyRoute; - "/dashboard/settings/display": typeof AuthenticatedDashboardSettingsDisplayLazyRoute; - "/dashboard/settings/notifications": typeof AuthenticatedDashboardSettingsNotificationsLazyRoute; - "/dashboard/settings/security": typeof AuthenticatedDashboardSettingsSecurityLazyRoute; - "/dashboard/chats": typeof AuthenticatedDashboardChatsIndexLazyRoute; - "/dashboard/products": typeof AuthenticatedDashboardProductsIndexLazyRoute; - "/dashboard/settings/": typeof AuthenticatedDashboardSettingsIndexLazyRoute; - "/dashboard/shop": typeof AuthenticatedDashboardShopIndexLazyRoute; - "/dashboard/tasks": typeof AuthenticatedDashboardTasksIndexLazyRoute; - "/dashboard/users": typeof AuthenticatedDashboardUsersIndexLazyRoute; + '/': typeof IndexRoute + '': typeof AuthenticatedRouteRouteWithChildren + '/500': typeof errors500LazyRoute + '/otp': typeof authOtpRoute + '/sign-in': typeof authSignInRoute + '/forgot-password': typeof authForgotPasswordLazyRoute + '/sign-in-2': typeof authSignIn2LazyRoute + '/sign-up': typeof authSignUpLazyRoute + '/401': typeof errors401LazyRoute + '/403': typeof errors403LazyRoute + '/404': typeof errors404LazyRoute + '/503': typeof errors503LazyRoute + '/dashboard/settings': typeof AuthenticatedDashboardSettingsRouteLazyRouteWithChildren + '/dashboard': typeof AuthenticatedDashboardIndexRoute + '/help-center': typeof AuthenticatedHelpCenterIndexLazyRoute + '/dashboard/sales/coupons': typeof AuthenticatedDashboardSalesCouponsLazyRoute + '/dashboard/sales/recent-sales': typeof AuthenticatedDashboardSalesRecentSalesLazyRoute + '/dashboard/settings/appearance': typeof AuthenticatedDashboardSettingsAppearanceLazyRoute + '/dashboard/chats': typeof AuthenticatedDashboardChatsIndexLazyRoute + '/dashboard/mock': typeof AuthenticatedDashboardMockIndexLazyRoute + '/dashboard/products': typeof AuthenticatedDashboardProductsIndexLazyRoute + '/dashboard/settings/': typeof AuthenticatedDashboardSettingsIndexLazyRoute + '/dashboard/shop': typeof AuthenticatedDashboardShopIndexLazyRoute + '/dashboard/users': typeof AuthenticatedDashboardUsersIndexLazyRoute } export interface FileRoutesByTo { - "/": typeof IndexRoute; - "": typeof AuthenticatedRouteRouteWithChildren; - "/500": typeof errors500LazyRoute; - "/otp": typeof authOtpRoute; - "/sign-in": typeof authSignInRoute; - "/forgot-password": typeof authForgotPasswordLazyRoute; - "/sign-in-2": typeof authSignIn2LazyRoute; - "/sign-up": typeof authSignUpLazyRoute; - "/401": typeof errors401LazyRoute; - "/403": typeof errors403LazyRoute; - "/404": typeof errors404LazyRoute; - "/503": typeof errors503LazyRoute; - "/dashboard": typeof AuthenticatedDashboardIndexRoute; - "/help-center": typeof AuthenticatedHelpCenterIndexLazyRoute; - "/dashboard/sales/coupons": typeof AuthenticatedDashboardSalesCouponsLazyRoute; - "/dashboard/sales/recent-sales": typeof AuthenticatedDashboardSalesRecentSalesLazyRoute; - "/dashboard/settings/account": typeof AuthenticatedDashboardSettingsAccountLazyRoute; - "/dashboard/settings/appearance": typeof AuthenticatedDashboardSettingsAppearanceLazyRoute; - "/dashboard/settings/display": typeof AuthenticatedDashboardSettingsDisplayLazyRoute; - "/dashboard/settings/notifications": typeof AuthenticatedDashboardSettingsNotificationsLazyRoute; - "/dashboard/settings/security": typeof AuthenticatedDashboardSettingsSecurityLazyRoute; - "/dashboard/chats": typeof AuthenticatedDashboardChatsIndexLazyRoute; - "/dashboard/products": typeof AuthenticatedDashboardProductsIndexLazyRoute; - "/dashboard/settings": typeof AuthenticatedDashboardSettingsIndexLazyRoute; - "/dashboard/shop": typeof AuthenticatedDashboardShopIndexLazyRoute; - "/dashboard/tasks": typeof AuthenticatedDashboardTasksIndexLazyRoute; - "/dashboard/users": typeof AuthenticatedDashboardUsersIndexLazyRoute; + '/': typeof IndexRoute + '': typeof AuthenticatedRouteRouteWithChildren + '/500': typeof errors500LazyRoute + '/otp': typeof authOtpRoute + '/sign-in': typeof authSignInRoute + '/forgot-password': typeof authForgotPasswordLazyRoute + '/sign-in-2': typeof authSignIn2LazyRoute + '/sign-up': typeof authSignUpLazyRoute + '/401': typeof errors401LazyRoute + '/403': typeof errors403LazyRoute + '/404': typeof errors404LazyRoute + '/503': typeof errors503LazyRoute + '/dashboard': typeof AuthenticatedDashboardIndexRoute + '/help-center': typeof AuthenticatedHelpCenterIndexLazyRoute + '/dashboard/sales/coupons': typeof AuthenticatedDashboardSalesCouponsLazyRoute + '/dashboard/sales/recent-sales': typeof AuthenticatedDashboardSalesRecentSalesLazyRoute + '/dashboard/settings/appearance': typeof AuthenticatedDashboardSettingsAppearanceLazyRoute + '/dashboard/chats': typeof AuthenticatedDashboardChatsIndexLazyRoute + '/dashboard/mock': typeof AuthenticatedDashboardMockIndexLazyRoute + '/dashboard/products': typeof AuthenticatedDashboardProductsIndexLazyRoute + '/dashboard/settings': typeof AuthenticatedDashboardSettingsIndexLazyRoute + '/dashboard/shop': typeof AuthenticatedDashboardShopIndexLazyRoute + '/dashboard/users': typeof AuthenticatedDashboardUsersIndexLazyRoute } export interface FileRoutesById { - __root__: typeof rootRoute; - "/": typeof IndexRoute; - "/_authenticated": typeof AuthenticatedRouteRouteWithChildren; - "/(auth)/500": typeof auth500Route; - "/(auth)/otp": typeof authOtpRoute; - "/(auth)/sign-in": typeof authSignInRoute; - "/(auth)/forgot-password": typeof authForgotPasswordLazyRoute; - "/(auth)/sign-in-2": typeof authSignIn2LazyRoute; - "/(auth)/sign-up": typeof authSignUpLazyRoute; - "/(errors)/401": typeof errors401LazyRoute; - "/(errors)/403": typeof errors403LazyRoute; - "/(errors)/404": typeof errors404LazyRoute; - "/(errors)/500": typeof errors500LazyRoute; - "/(errors)/503": typeof errors503LazyRoute; - "/_authenticated/dashboard/settings": typeof AuthenticatedDashboardSettingsRouteLazyRouteWithChildren; - "/_authenticated/dashboard/": typeof AuthenticatedDashboardIndexRoute; - "/_authenticated/help-center/": typeof AuthenticatedHelpCenterIndexLazyRoute; - "/_authenticated/dashboard/sales/coupons": typeof AuthenticatedDashboardSalesCouponsLazyRoute; - "/_authenticated/dashboard/sales/recent-sales": typeof AuthenticatedDashboardSalesRecentSalesLazyRoute; - "/_authenticated/dashboard/settings/account": typeof AuthenticatedDashboardSettingsAccountLazyRoute; - "/_authenticated/dashboard/settings/appearance": typeof AuthenticatedDashboardSettingsAppearanceLazyRoute; - "/_authenticated/dashboard/settings/display": typeof AuthenticatedDashboardSettingsDisplayLazyRoute; - "/_authenticated/dashboard/settings/notifications": typeof AuthenticatedDashboardSettingsNotificationsLazyRoute; - "/_authenticated/dashboard/settings/security": typeof AuthenticatedDashboardSettingsSecurityLazyRoute; - "/_authenticated/dashboard/chats/": typeof AuthenticatedDashboardChatsIndexLazyRoute; - "/_authenticated/dashboard/products/": typeof AuthenticatedDashboardProductsIndexLazyRoute; - "/_authenticated/dashboard/settings/": typeof AuthenticatedDashboardSettingsIndexLazyRoute; - "/_authenticated/dashboard/shop/": typeof AuthenticatedDashboardShopIndexLazyRoute; - "/_authenticated/dashboard/tasks/": typeof AuthenticatedDashboardTasksIndexLazyRoute; - "/_authenticated/dashboard/users/": typeof AuthenticatedDashboardUsersIndexLazyRoute; + __root__: typeof rootRoute + '/': typeof IndexRoute + '/_authenticated': typeof AuthenticatedRouteRouteWithChildren + '/(auth)/500': typeof auth500Route + '/(auth)/otp': typeof authOtpRoute + '/(auth)/sign-in': typeof authSignInRoute + '/(auth)/forgot-password': typeof authForgotPasswordLazyRoute + '/(auth)/sign-in-2': typeof authSignIn2LazyRoute + '/(auth)/sign-up': typeof authSignUpLazyRoute + '/(errors)/401': typeof errors401LazyRoute + '/(errors)/403': typeof errors403LazyRoute + '/(errors)/404': typeof errors404LazyRoute + '/(errors)/500': typeof errors500LazyRoute + '/(errors)/503': typeof errors503LazyRoute + '/_authenticated/dashboard/settings': typeof AuthenticatedDashboardSettingsRouteLazyRouteWithChildren + '/_authenticated/dashboard/': typeof AuthenticatedDashboardIndexRoute + '/_authenticated/help-center/': typeof AuthenticatedHelpCenterIndexLazyRoute + '/_authenticated/dashboard/sales/coupons': typeof AuthenticatedDashboardSalesCouponsLazyRoute + '/_authenticated/dashboard/sales/recent-sales': typeof AuthenticatedDashboardSalesRecentSalesLazyRoute + '/_authenticated/dashboard/settings/appearance': typeof AuthenticatedDashboardSettingsAppearanceLazyRoute + '/_authenticated/dashboard/chats/': typeof AuthenticatedDashboardChatsIndexLazyRoute + '/_authenticated/dashboard/mock/': typeof AuthenticatedDashboardMockIndexLazyRoute + '/_authenticated/dashboard/products/': typeof AuthenticatedDashboardProductsIndexLazyRoute + '/_authenticated/dashboard/settings/': typeof AuthenticatedDashboardSettingsIndexLazyRoute + '/_authenticated/dashboard/shop/': typeof AuthenticatedDashboardShopIndexLazyRoute + '/_authenticated/dashboard/users/': typeof AuthenticatedDashboardUsersIndexLazyRoute } export interface FileRouteTypes { - fileRoutesByFullPath: FileRoutesByFullPath; - fullPaths: - | "/" - | "" - | "/500" - | "/otp" - | "/sign-in" - | "/forgot-password" - | "/sign-in-2" - | "/sign-up" - | "/401" - | "/403" - | "/404" - | "/503" - | "/dashboard/settings" - | "/dashboard" - | "/help-center" - | "/dashboard/sales/coupons" - | "/dashboard/sales/recent-sales" - | "/dashboard/settings/account" - | "/dashboard/settings/appearance" - | "/dashboard/settings/display" - | "/dashboard/settings/notifications" - | "/dashboard/settings/security" - | "/dashboard/chats" - | "/dashboard/products" - | "/dashboard/settings/" - | "/dashboard/shop" - | "/dashboard/tasks" - | "/dashboard/users"; - fileRoutesByTo: FileRoutesByTo; - to: - | "/" - | "" - | "/500" - | "/otp" - | "/sign-in" - | "/forgot-password" - | "/sign-in-2" - | "/sign-up" - | "/401" - | "/403" - | "/404" - | "/503" - | "/dashboard" - | "/help-center" - | "/dashboard/sales/coupons" - | "/dashboard/sales/recent-sales" - | "/dashboard/settings/account" - | "/dashboard/settings/appearance" - | "/dashboard/settings/display" - | "/dashboard/settings/notifications" - | "/dashboard/settings/security" - | "/dashboard/chats" - | "/dashboard/products" - | "/dashboard/settings" - | "/dashboard/shop" - | "/dashboard/tasks" - | "/dashboard/users"; - id: - | "__root__" - | "/" - | "/_authenticated" - | "/(auth)/500" - | "/(auth)/otp" - | "/(auth)/sign-in" - | "/(auth)/forgot-password" - | "/(auth)/sign-in-2" - | "/(auth)/sign-up" - | "/(errors)/401" - | "/(errors)/403" - | "/(errors)/404" - | "/(errors)/500" - | "/(errors)/503" - | "/_authenticated/dashboard/settings" - | "/_authenticated/dashboard/" - | "/_authenticated/help-center/" - | "/_authenticated/dashboard/sales/coupons" - | "/_authenticated/dashboard/sales/recent-sales" - | "/_authenticated/dashboard/settings/account" - | "/_authenticated/dashboard/settings/appearance" - | "/_authenticated/dashboard/settings/display" - | "/_authenticated/dashboard/settings/notifications" - | "/_authenticated/dashboard/settings/security" - | "/_authenticated/dashboard/chats/" - | "/_authenticated/dashboard/products/" - | "/_authenticated/dashboard/settings/" - | "/_authenticated/dashboard/shop/" - | "/_authenticated/dashboard/tasks/" - | "/_authenticated/dashboard/users/"; - fileRoutesById: FileRoutesById; + fileRoutesByFullPath: FileRoutesByFullPath + fullPaths: + | '/' + | '' + | '/500' + | '/otp' + | '/sign-in' + | '/forgot-password' + | '/sign-in-2' + | '/sign-up' + | '/401' + | '/403' + | '/404' + | '/503' + | '/dashboard/settings' + | '/dashboard' + | '/help-center' + | '/dashboard/sales/coupons' + | '/dashboard/sales/recent-sales' + | '/dashboard/settings/appearance' + | '/dashboard/chats' + | '/dashboard/mock' + | '/dashboard/products' + | '/dashboard/settings/' + | '/dashboard/shop' + | '/dashboard/users' + fileRoutesByTo: FileRoutesByTo + to: + | '/' + | '' + | '/500' + | '/otp' + | '/sign-in' + | '/forgot-password' + | '/sign-in-2' + | '/sign-up' + | '/401' + | '/403' + | '/404' + | '/503' + | '/dashboard' + | '/help-center' + | '/dashboard/sales/coupons' + | '/dashboard/sales/recent-sales' + | '/dashboard/settings/appearance' + | '/dashboard/chats' + | '/dashboard/mock' + | '/dashboard/products' + | '/dashboard/settings' + | '/dashboard/shop' + | '/dashboard/users' + id: + | '__root__' + | '/' + | '/_authenticated' + | '/(auth)/500' + | '/(auth)/otp' + | '/(auth)/sign-in' + | '/(auth)/forgot-password' + | '/(auth)/sign-in-2' + | '/(auth)/sign-up' + | '/(errors)/401' + | '/(errors)/403' + | '/(errors)/404' + | '/(errors)/500' + | '/(errors)/503' + | '/_authenticated/dashboard/settings' + | '/_authenticated/dashboard/' + | '/_authenticated/help-center/' + | '/_authenticated/dashboard/sales/coupons' + | '/_authenticated/dashboard/sales/recent-sales' + | '/_authenticated/dashboard/settings/appearance' + | '/_authenticated/dashboard/chats/' + | '/_authenticated/dashboard/mock/' + | '/_authenticated/dashboard/products/' + | '/_authenticated/dashboard/settings/' + | '/_authenticated/dashboard/shop/' + | '/_authenticated/dashboard/users/' + fileRoutesById: FileRoutesById } export interface RootRouteChildren { - IndexRoute: typeof IndexRoute; - AuthenticatedRouteRoute: typeof AuthenticatedRouteRouteWithChildren; - auth500Route: typeof auth500Route; - authOtpRoute: typeof authOtpRoute; - authSignInRoute: typeof authSignInRoute; - authForgotPasswordLazyRoute: typeof authForgotPasswordLazyRoute; - authSignIn2LazyRoute: typeof authSignIn2LazyRoute; - authSignUpLazyRoute: typeof authSignUpLazyRoute; - errors401LazyRoute: typeof errors401LazyRoute; - errors403LazyRoute: typeof errors403LazyRoute; - errors404LazyRoute: typeof errors404LazyRoute; - errors500LazyRoute: typeof errors500LazyRoute; - errors503LazyRoute: typeof errors503LazyRoute; + IndexRoute: typeof IndexRoute + AuthenticatedRouteRoute: typeof AuthenticatedRouteRouteWithChildren + auth500Route: typeof auth500Route + authOtpRoute: typeof authOtpRoute + authSignInRoute: typeof authSignInRoute + authForgotPasswordLazyRoute: typeof authForgotPasswordLazyRoute + authSignIn2LazyRoute: typeof authSignIn2LazyRoute + authSignUpLazyRoute: typeof authSignUpLazyRoute + errors401LazyRoute: typeof errors401LazyRoute + errors403LazyRoute: typeof errors403LazyRoute + errors404LazyRoute: typeof errors404LazyRoute + errors500LazyRoute: typeof errors500LazyRoute + errors503LazyRoute: typeof errors503LazyRoute } const rootRouteChildren: RootRouteChildren = { - IndexRoute: IndexRoute, - AuthenticatedRouteRoute: AuthenticatedRouteRouteWithChildren, - auth500Route: auth500Route, - authOtpRoute: authOtpRoute, - authSignInRoute: authSignInRoute, - authForgotPasswordLazyRoute: authForgotPasswordLazyRoute, - authSignIn2LazyRoute: authSignIn2LazyRoute, - authSignUpLazyRoute: authSignUpLazyRoute, - errors401LazyRoute: errors401LazyRoute, - errors403LazyRoute: errors403LazyRoute, - errors404LazyRoute: errors404LazyRoute, - errors500LazyRoute: errors500LazyRoute, - errors503LazyRoute: errors503LazyRoute, -}; + IndexRoute: IndexRoute, + AuthenticatedRouteRoute: AuthenticatedRouteRouteWithChildren, + auth500Route: auth500Route, + authOtpRoute: authOtpRoute, + authSignInRoute: authSignInRoute, + authForgotPasswordLazyRoute: authForgotPasswordLazyRoute, + authSignIn2LazyRoute: authSignIn2LazyRoute, + authSignUpLazyRoute: authSignUpLazyRoute, + errors401LazyRoute: errors401LazyRoute, + errors403LazyRoute: errors403LazyRoute, + errors404LazyRoute: errors404LazyRoute, + errors500LazyRoute: errors500LazyRoute, + errors503LazyRoute: errors503LazyRoute, +} export const routeTree = rootRoute - ._addFileChildren(rootRouteChildren) - ._addFileTypes(); + ._addFileChildren(rootRouteChildren) + ._addFileTypes() /* ROUTE_MANIFEST_START { @@ -883,9 +763,9 @@ export const routeTree = rootRoute "/_authenticated/dashboard/sales/coupons", "/_authenticated/dashboard/sales/recent-sales", "/_authenticated/dashboard/chats/", + "/_authenticated/dashboard/mock/", "/_authenticated/dashboard/products/", "/_authenticated/dashboard/shop/", - "/_authenticated/dashboard/tasks/", "/_authenticated/dashboard/users/" ] }, @@ -926,11 +806,7 @@ export const routeTree = rootRoute "filePath": "_authenticated/dashboard/settings/route.lazy.tsx", "parent": "/_authenticated", "children": [ - "/_authenticated/dashboard/settings/account", "/_authenticated/dashboard/settings/appearance", - "/_authenticated/dashboard/settings/display", - "/_authenticated/dashboard/settings/notifications", - "/_authenticated/dashboard/settings/security", "/_authenticated/dashboard/settings/" ] }, @@ -950,30 +826,18 @@ export const routeTree = rootRoute "filePath": "_authenticated/dashboard/sales/recent-sales.lazy.tsx", "parent": "/_authenticated" }, - "/_authenticated/dashboard/settings/account": { - "filePath": "_authenticated/dashboard/settings/account.lazy.tsx", - "parent": "/_authenticated/dashboard/settings" - }, "/_authenticated/dashboard/settings/appearance": { "filePath": "_authenticated/dashboard/settings/appearance.lazy.tsx", "parent": "/_authenticated/dashboard/settings" }, - "/_authenticated/dashboard/settings/display": { - "filePath": "_authenticated/dashboard/settings/display.lazy.tsx", - "parent": "/_authenticated/dashboard/settings" - }, - "/_authenticated/dashboard/settings/notifications": { - "filePath": "_authenticated/dashboard/settings/notifications.lazy.tsx", - "parent": "/_authenticated/dashboard/settings" - }, - "/_authenticated/dashboard/settings/security": { - "filePath": "_authenticated/dashboard/settings/security.lazy.tsx", - "parent": "/_authenticated/dashboard/settings" - }, "/_authenticated/dashboard/chats/": { "filePath": "_authenticated/dashboard/chats/index.lazy.tsx", "parent": "/_authenticated" }, + "/_authenticated/dashboard/mock/": { + "filePath": "_authenticated/dashboard/mock/index.lazy.tsx", + "parent": "/_authenticated" + }, "/_authenticated/dashboard/products/": { "filePath": "_authenticated/dashboard/products/index.lazy.tsx", "parent": "/_authenticated" @@ -986,10 +850,6 @@ export const routeTree = rootRoute "filePath": "_authenticated/dashboard/shop/index.lazy.tsx", "parent": "/_authenticated" }, - "/_authenticated/dashboard/tasks/": { - "filePath": "_authenticated/dashboard/tasks/index.lazy.tsx", - "parent": "/_authenticated" - }, "/_authenticated/dashboard/users/": { "filePath": "_authenticated/dashboard/users/index.lazy.tsx", "parent": "/_authenticated" diff --git a/frontend/src/routes/(auth)/sign-in.tsx b/frontend/src/routes/(auth)/sign-in.tsx index 5734c1e..3d4712a 100644 --- a/frontend/src/routes/(auth)/sign-in.tsx +++ b/frontend/src/routes/(auth)/sign-in.tsx @@ -7,7 +7,7 @@ export const Route = createFileRoute("/(auth)/sign-in")({ beforeLoad: async () => { if (isLoggedIn()) { throw redirect({ - to: "/dashboard", + to: "/dashboard/shop", }); } }, diff --git a/frontend/src/routes/_authenticated/dashboard/mock/index.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/mock/index.lazy.tsx new file mode 100644 index 0000000..50dc689 --- /dev/null +++ b/frontend/src/routes/_authenticated/dashboard/mock/index.lazy.tsx @@ -0,0 +1,11 @@ +import { createSamplePurchase } from '@/api/mock/data/create-purchase-data' +import { Button } from '@/components/ui/button' +import { createLazyFileRoute } from '@tanstack/react-router' + +export const Route = createLazyFileRoute('/_authenticated/dashboard/mock/')({ + component: RouteComponent, +}) + +function RouteComponent() { + return +} diff --git a/frontend/src/routes/_authenticated/dashboard/sales/recent-sales.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/sales/recent-sales.lazy.tsx index 3763e9c..43d6aae 100644 --- a/frontend/src/routes/_authenticated/dashboard/sales/recent-sales.lazy.tsx +++ b/frontend/src/routes/_authenticated/dashboard/sales/recent-sales.lazy.tsx @@ -1,11 +1,9 @@ +import RecentSales from "@/pages/sales/recent-sales"; import { createLazyFileRoute } from "@tanstack/react-router"; export const Route = createLazyFileRoute( "/_authenticated/dashboard/sales/recent-sales", )({ - component: RouteComponent, + component: RecentSales, }); -function RouteComponent() { - return
    Recent Sales
    ; -} diff --git a/frontend/src/routes/_authenticated/dashboard/settings/account.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/settings/account.lazy.tsx deleted file mode 100644 index be0dc64..0000000 --- a/frontend/src/routes/_authenticated/dashboard/settings/account.lazy.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { createLazyFileRoute } from "@tanstack/react-router"; -import SettingsAccount from "@/pages/settings/account"; - -export const Route = createLazyFileRoute( - "/_authenticated/dashboard/settings/account", -)({ - component: SettingsAccount, -}); diff --git a/frontend/src/routes/_authenticated/dashboard/settings/display.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/settings/display.lazy.tsx deleted file mode 100644 index 78d617a..0000000 --- a/frontend/src/routes/_authenticated/dashboard/settings/display.lazy.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { createLazyFileRoute } from "@tanstack/react-router"; -import SettingsDisplay from "@/pages/settings/display"; - -export const Route = createLazyFileRoute( - "/_authenticated/dashboard/settings/display", -)({ - component: SettingsDisplay, -}); diff --git a/frontend/src/routes/_authenticated/dashboard/settings/notifications.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/settings/notifications.lazy.tsx deleted file mode 100644 index 153b48a..0000000 --- a/frontend/src/routes/_authenticated/dashboard/settings/notifications.lazy.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import { createLazyFileRoute } from "@tanstack/react-router"; -import SettingsNotifications from "@/pages/settings/notifications"; - -export const Route = createLazyFileRoute( - "/_authenticated/dashboard/settings/notifications", -)({ - component: SettingsNotifications, -}); diff --git a/frontend/src/routes/_authenticated/dashboard/settings/security.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/settings/security.lazy.tsx deleted file mode 100644 index 1c2a251..0000000 --- a/frontend/src/routes/_authenticated/dashboard/settings/security.lazy.tsx +++ /dev/null @@ -1,8 +0,0 @@ -import SettingsSecurity from "@/pages/settings/security"; -import { createLazyFileRoute } from "@tanstack/react-router"; - -export const Route = createLazyFileRoute( - "/_authenticated/dashboard/settings/security", -)({ - component: SettingsSecurity, -}); diff --git a/frontend/src/routes/_authenticated/dashboard/tasks/index.lazy.tsx b/frontend/src/routes/_authenticated/dashboard/tasks/index.lazy.tsx deleted file mode 100644 index 9c0d5ce..0000000 --- a/frontend/src/routes/_authenticated/dashboard/tasks/index.lazy.tsx +++ /dev/null @@ -1,6 +0,0 @@ -import { createLazyFileRoute } from "@tanstack/react-router"; -import Tasks from "@/pages/tasks"; - -export const Route = createLazyFileRoute("/_authenticated/dashboard/tasks/")({ - component: Tasks, -}); diff --git a/frontend/src/utils/token-validation.ts b/frontend/src/utils/token-validation.ts index 04e52ec..30ab8da 100644 --- a/frontend/src/utils/token-validation.ts +++ b/frontend/src/utils/token-validation.ts @@ -1,13 +1,13 @@ -import jwt_decode from "jwt-decode"; +// import jwt_decode from "jwt-decode"; -export function isTokenValid(token: string | null): boolean { - if (!token) return false; - try { - const decoded: { exp: number } = jwt_decode(token); - const now = Date.now() / 1000; - return decoded.exp > now; - } catch (e) { - console.warn("Invalid token format:", e); - return false; - } -} +// export function isTokenValid(token: string | null): boolean { +// if (!token) return false; +// try { +// const decoded: { exp: number } = jwt_decode(token); +// const now = Date.now() / 1000; +// return decoded.exp > now; +// } catch (e) { +// console.warn("Invalid token format:", e); +// return false; +// } +// }