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,6 +1,7 @@
"use client";
import { clientFetch } from "../api-client";
import { clientFetch } from '@/lib/api/api-client';
import { formatGBP } from '@/lib/utils/format';
// Analytics Types
export interface AnalyticsOverview {
@@ -293,15 +294,6 @@ export const getGrowthAnalyticsWithStore =
return getGrowthAnalytics(storeId);
};
export function formatGBP(value: number) {
return value.toLocaleString("en-GB", {
style: "currency",
currency: "GBP",
minimumFractionDigits: 2,
maximumFractionDigits: 2,
});
}
// Prediction Types
export interface SalesPrediction {
predicted: number | null;

View File

@@ -0,0 +1,8 @@
// This file is maintained for backward compatibility
// Import from the new consolidated API
export {
getCustomers,
getCustomerDetails,
type CustomerStats,
type CustomerResponse
} from '../lib/api';

View File

@@ -1,5 +1,3 @@
// Re-export all service functionality
export * from './product-service';
export * from './shipping-service';
export * from './stats-service';
export * from '../api-client';
// Re-export all services from the lib directory
// This provides backward compatibility
export * from '../lib/api';

View File

@@ -1,4 +1,4 @@
import { clientFetch } from '../api-client';
import { clientFetch } from '@/lib/api/api-client';
// Product data types
export interface Product {

View File

@@ -1,4 +1,4 @@
import { clientFetch } from '../api-client';
import { clientFetch } from '@/lib/api/api-client';
/**
* Shipping service - Handles shipping options

View File

@@ -1,4 +1,4 @@
import { clientFetch } from '../api-client';
import { clientFetch } from '@/lib/api/api-client';
// Stats data types
export interface PlatformStats {