- Updated import paths for various components to align with new directory structure. - Changed imports from 'row-actions', 'confirm-dialog', 'image-preview-button', and 'file-upload' to their respective new locations in 'data-display', 'dialogs', and 'inputs'. - Adjusted imports in multiple pages including purchase, restock, transaction, category, customer, product, raw-material, supplier, roles, and settings. - Ensured all relevant components are imported from their new locations to maintain functionality.
55 lines
1.6 KiB
TypeScript
55 lines
1.6 KiB
TypeScript
import { createInertiaApp } from '@inertiajs/react';
|
|
import { registerSW } from 'virtual:pwa-register';
|
|
import { FlashToast } from '@/components/notifications';
|
|
import { PWAUpdateToast } from '@/components/notifications';
|
|
import { Toaster } from '@/components/ui/sonner';
|
|
import { TooltipProvider } from '@/components/ui/tooltip';
|
|
import { initializeTheme } from '@/hooks/use-appearance';
|
|
import AppLayout from '@/layouts/app-layout';
|
|
import AuthLayout from '@/layouts/auth-layout';
|
|
import SettingsLayout from '@/layouts/settings/layout';
|
|
|
|
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
|
|
|
registerSW({
|
|
onNeedRefresh() {
|
|
window.dispatchEvent(new CustomEvent('sw-update-available'));
|
|
},
|
|
onOfflineReady() {
|
|
window.dispatchEvent(new CustomEvent('sw-offline-ready'));
|
|
},
|
|
});
|
|
|
|
createInertiaApp({
|
|
title: (title) => (title ? `${title} - ${appName}` : appName),
|
|
layout: (name) => {
|
|
switch (true) {
|
|
case name === 'welcome':
|
|
return null;
|
|
case name.startsWith('auth/'):
|
|
return AuthLayout;
|
|
case name.startsWith('settings/'):
|
|
return [AppLayout, SettingsLayout];
|
|
default:
|
|
return AppLayout;
|
|
}
|
|
},
|
|
strictMode: true,
|
|
withApp(app) {
|
|
return (
|
|
<TooltipProvider delayDuration={0}>
|
|
<FlashToast />
|
|
<PWAUpdateToast />
|
|
{app}
|
|
<Toaster />
|
|
</TooltipProvider>
|
|
);
|
|
},
|
|
progress: {
|
|
color: '#4B5563',
|
|
},
|
|
});
|
|
|
|
// This will set light / dark mode on load...
|
|
initializeTheme();
|