46 lines
1.8 KiB
TypeScript
46 lines
1.8 KiB
TypeScript
import { Store, Phone, ShoppingCart, ClipboardList, Home, FileText, type LucideIcon } from 'lucide-react';
|
|
import {
|
|
OrdersView,
|
|
CallsView,
|
|
StoresView,
|
|
DailyLogsView,
|
|
type WiredRecordViewProps,
|
|
} from '../components/rv';
|
|
import {
|
|
OrderDetail,
|
|
CallDetail,
|
|
StoreDetail,
|
|
DailyLogDetail,
|
|
type WiredDetailViewProps,
|
|
} from '../components/dv';
|
|
|
|
import { AnalyticsPage } from './AnalyticsPage';
|
|
import { DailySalesReportPage } from './DailySalesReportPage';
|
|
import { BarChart2 } from 'lucide-react';
|
|
|
|
export type ScreenKey = 'orders' | 'calls' | 'stores' | 'daily' | 'analytics' | 'all-daily' | 'sales-report';
|
|
|
|
export interface ScreenDef {
|
|
key: ScreenKey;
|
|
label: string;
|
|
icon: LucideIcon;
|
|
View: (p: WiredRecordViewProps) => React.JSX.Element | React.FC;
|
|
Detail?: (p: WiredDetailViewProps) => React.JSX.Element;
|
|
/** Singular noun for the detail title. */
|
|
noun?: string;
|
|
}
|
|
|
|
export const SCREENS: ScreenDef[] = [
|
|
{ key: 'daily', label: 'Home', icon: Home, View: DailyLogsView, Detail: DailyLogDetail, noun: 'Daily Log' },
|
|
{ key: 'orders', label: 'Orders', icon: ShoppingCart, View: OrdersView, Detail: OrderDetail, noun: 'Order' },
|
|
{ key: 'calls', label: 'Calls', icon: Phone, View: CallsView, Detail: CallDetail, noun: 'Call' },
|
|
{ key: 'stores', label: 'Stores', icon: Store, View: StoresView, Detail: StoreDetail, noun: 'Store' },
|
|
{ key: 'all-daily', label: 'All Logs', icon: ClipboardList, View: DailyLogsView, Detail: DailyLogDetail, noun: 'Daily Log' },
|
|
{ key: 'analytics', label: 'Analytics', icon: BarChart2, View: AnalyticsPage as any },
|
|
{ key: 'sales-report', label: 'Sales Report', icon: FileText, View: DailySalesReportPage as any }
|
|
];
|
|
|
|
export function screenByKey(key: string | undefined): ScreenDef | undefined {
|
|
return SCREENS.find((t) => t.key === key);
|
|
}
|