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

@@ -7,17 +7,17 @@ import {
CardDescription,
CardHeader,
CardTitle,
} from "@/components/ui/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
import { Badge } from "@/components/ui/badge";
import { Button } from "@/components/ui/button";
} from "@/components/common/card";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/common/tabs";
import { Badge } from "@/components/common/badge";
import { Button } from "@/components/common/button";
import {
Select,
SelectContent,
SelectItem,
SelectTrigger,
SelectValue,
} from "@/components/ui/select";
} from "@/components/common/select";
import {
TrendingUp,
ShoppingCart,
@@ -32,21 +32,21 @@ import {
EyeOff,
Calculator,
} from "lucide-react";
import { useToast } from "@/hooks/use-toast";
import { useToast } from "@/lib/hooks/use-toast";
import MetricsCard from "./MetricsCard";
import {
getAnalyticsOverviewWithStore,
type AnalyticsOverview,
} from "@/lib/services/analytics-service";
import { formatGBP } from "@/utils/format";
import { formatGBP, formatNumber } from "@/lib/utils/format";
import { MetricsCardSkeleton } from "./SkeletonLoaders";
import dynamic from "next/dynamic";
import { Skeleton } from "@/components/ui/skeleton";
import { DateRangePicker } from "@/components/ui/date-picker";
import { Skeleton } from "@/components/common/skeleton";
import { DateRangePicker } from "@/components/common/date-picker";
import { DateRange } from "react-day-picker";
import { addDays, startOfDay, endOfDay } from "date-fns";
import type { DateRange as ProfitDateRange } from "@/lib/services/profit-analytics-service";
import { MotionWrapper } from "@/components/ui/motion-wrapper";
import { MotionWrapper } from "@/components/common/motion-wrapper";
import { motion } from "framer-motion";
const RevenueChart = dynamic(() => import("./RevenueChart"), {
@@ -170,7 +170,7 @@ export default function AnalyticsDashboard({
},
{
title: "Total Orders",
value: maskValue(data.orders.total.toLocaleString()),
value: maskValue(formatNumber(data.orders.total)),
description: "All-time orders",
icon: ShoppingCart,
trend: data.orders.completed > 0 ? ("up" as const) : ("neutral" as const),
@@ -178,7 +178,7 @@ export default function AnalyticsDashboard({
},
{
title: "Unique Customers",
value: maskValue(data.customers.unique.toLocaleString()),
value: maskValue(formatNumber(data.customers.unique)),
description: "Total customers",
icon: Users,
trend: "neutral" as const,
@@ -186,7 +186,7 @@ export default function AnalyticsDashboard({
},
{
title: "Products",
value: maskValue(data.products.total.toLocaleString()),
value: maskValue(formatNumber(data.products.total)),
description: "Active products",
icon: Package,
trend: "neutral" as const,
@@ -451,3 +451,5 @@ export default function AnalyticsDashboard({
</div>
);
}