- 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.
29 lines
711 B
TypeScript
29 lines
711 B
TypeScript
import { usePage } from '@inertiajs/react';
|
|
import type { ReactNode } from 'react';
|
|
import { SidebarProvider } from '@/components/ui/sidebar';
|
|
import type { AppVariant } from '@/types';
|
|
|
|
type Props = {
|
|
children: ReactNode;
|
|
variant?: AppVariant;
|
|
};
|
|
|
|
export function AppShell({ children, variant = 'sidebar' }: Props) {
|
|
const isOpen = usePage().props.sidebarOpen;
|
|
|
|
if (variant === 'header') {
|
|
return (
|
|
<div className="flex min-h-screen w-full flex-col">{children}</div>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<SidebarProvider
|
|
defaultOpen={isOpen}
|
|
className="h-screen overflow-hidden"
|
|
>
|
|
{children}
|
|
</SidebarProvider>
|
|
);
|
|
}
|