mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-02 22:46:16 +00:00
#591 - database-users
This commit is contained in:
@ -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>
|
||||
);
|
||||
|
Reference in New Issue
Block a user