- Added InvoiceIndex component for displaying a list of invoices with pagination and search capabilities. - Created InvoiceShareButton component for sharing invoice details via WhatsApp. - Developed InvoicePrint component for printing invoice details. - Defined routes for invoice management including share and print functionalities. - Implemented InvoiceTest to cover authentication, authorization, and CRUD operations for invoices.
61 lines
1.9 KiB
TypeScript
61 lines
1.9 KiB
TypeScript
import { FlashToast, PWAUpdateToast } from '@/components/notifications';
|
|
import { Toaster } from '@/components/ui/sonner';
|
|
import { TooltipProvider } from '@/components/ui/tooltip';
|
|
import { CartProvider } from '@/contexts/cart-context';
|
|
import { initializeTheme } from '@/hooks/use-appearance';
|
|
import AppLayout from '@/layouts/app-layout';
|
|
import AuthLayout from '@/layouts/auth-layout';
|
|
import SettingsLayout from '@/layouts/settings/layout';
|
|
import { createInertiaApp } from '@inertiajs/react';
|
|
import { registerSW } from 'virtual:pwa-register';
|
|
|
|
const appName = import.meta.env.VITE_APP_NAME || 'DST Collection';
|
|
|
|
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 === 'admin/manage/cutting/show':
|
|
case name === 'admin/manage/invoice/print':
|
|
return null;
|
|
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 (
|
|
<CartProvider>
|
|
<TooltipProvider delayDuration={0}>
|
|
<FlashToast />
|
|
<PWAUpdateToast />
|
|
{app}
|
|
<Toaster />
|
|
</TooltipProvider>
|
|
</CartProvider>
|
|
);
|
|
},
|
|
progress: {
|
|
color: '#d97706',
|
|
delay: 0,
|
|
},
|
|
});
|
|
|
|
// This will set light / dark mode on load...
|
|
initializeTheme();
|