Refactor UI imports and update component paths
Some checks failed
Build Frontend / build (push) Failing after 7s

Replaces imports from 'components/ui' with 'components/common' across the app and dashboard pages, and updates model and API imports to use new paths under 'lib'. Removes redundant authentication checks from several dashboard pages. Adds new dashboard components and utility files, and reorganizes hooks and services into the 'lib' directory for improved structure.
This commit is contained in:
g
2026-01-13 05:02:13 +00:00
parent a6e6cd0757
commit fe01f31538
173 changed files with 1512 additions and 867 deletions

View File

@@ -1,14 +1,14 @@
"use client"
import { useState, useEffect } from 'react';
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table";
import { Badge } from "@/components/ui/badge";
import { useToast } from "@/hooks/use-toast";
import { Skeleton } from "@/components/ui/skeleton";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/common/card";
import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/common/table";
import { Badge } from "@/components/common/badge";
import { useToast } from "@/lib/hooks/use-toast";
import { Skeleton } from "@/components/common/skeleton";
import { Package } from "lucide-react";
import { getProductPerformanceWithStore, type ProductPerformance } from "@/lib/services/analytics-service";
import { formatGBP } from "@/utils/format";
import { formatGBP, formatNumber } from "@/lib/utils/format";
import { TableSkeleton } from './SkeletonLoaders';
export default function ProductPerformanceChart() {
@@ -123,10 +123,10 @@ export default function ProductPerformanceChart() {
<TableRow key={product.productId}>
<TableCell>
<div className="flex items-center gap-3">
<div
<div
className="h-10 w-10 bg-cover bg-center rounded border flex-shrink-0"
style={{
backgroundImage: product.image
style={{
backgroundImage: product.image
? `url(/api/products/${product.productId}/image)`
: 'none'
}}
@@ -137,7 +137,7 @@ export default function ProductPerformanceChart() {
</div>
</TableCell>
<TableCell className="text-right font-medium">
{parseInt(product.totalSold.toFixed(0)).toLocaleString()} {product.unitType}
{formatNumber(parseInt(product.totalSold.toFixed(0)))} {product.unitType}
</TableCell>
<TableCell className="text-right font-medium text-green-600">
{formatGBP(product.totalRevenue)}
@@ -155,4 +155,5 @@ export default function ProductPerformanceChart() {
</CardContent>
</Card>
);
}
}