#591 - database-users

This commit is contained in:
Saeed Vaziry
2025-05-21 17:21:10 +02:00
parent 2850c1fa59
commit fe3317692b
41 changed files with 1050 additions and 409 deletions

View File

@ -1,9 +1,11 @@
import { AppSidebar } from '@/components/app-sidebar';
import { AppHeader } from '@/components/app-header';
import { type BreadcrumbItem, NavItem } from '@/types';
import { type BreadcrumbItem, NavItem, SharedData } from '@/types';
import { CSSProperties, type PropsWithChildren } from 'react';
import { SidebarInset, SidebarProvider } from '@/components/ui/sidebar';
import { usePoll } from '@inertiajs/react';
import { usePage, usePoll } from '@inertiajs/react';
import { Toaster } from '@/components/ui/sonner';
import { toast } from 'sonner';
export default function Layout({
children,
@ -16,6 +18,11 @@ export default function Layout({
}>) {
usePoll(10000);
const page = usePage<SharedData>();
if (page.props.flash && page.props.flash.success) toast.success(page.props.flash.success);
if (page.props.flash && page.props.flash.error) toast.error(page.props.flash.error);
return (
<SidebarProvider
style={
@ -29,6 +36,7 @@ export default function Layout({
<SidebarInset>
<AppHeader />
<div className="flex flex-1 flex-col">{children}</div>
<Toaster richColors />
</SidebarInset>
</SidebarProvider>
);