Refactor UI imports and update component paths
Some checks failed
Build Frontend / build (push) Failing after 7s
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:
@@ -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;
|
||||
|
||||
8
lib/services/customerService.ts
Normal file
8
lib/services/customerService.ts
Normal 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';
|
||||
@@ -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';
|
||||
@@ -1,4 +1,4 @@
|
||||
import { clientFetch } from '../api-client';
|
||||
import { clientFetch } from '@/lib/api/api-client';
|
||||
|
||||
// Product data types
|
||||
export interface Product {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { clientFetch } from '../api-client';
|
||||
import { clientFetch } from '@/lib/api/api-client';
|
||||
|
||||
/**
|
||||
* Shipping service - Handles shipping options
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { clientFetch } from '../api-client';
|
||||
import { clientFetch } from '@/lib/api/api-client';
|
||||
|
||||
// Stats data types
|
||||
export interface PlatformStats {
|
||||
|
||||
Reference in New Issue
Block a user