feat: update reservation form and add schema migration
This commit is contained in:
@@ -8,11 +8,16 @@ import { CalendarDays, Users, Home, Settings, Building2, CreditCard, LogOut, Rec
|
||||
|
||||
interface MainNavProps extends React.HTMLAttributes<HTMLElement> {
|
||||
onNavClick?: () => void
|
||||
user?: {
|
||||
name: string | null
|
||||
email: string | null
|
||||
}
|
||||
}
|
||||
|
||||
export function MainNav({
|
||||
className,
|
||||
onNavClick,
|
||||
user,
|
||||
...props
|
||||
}: MainNavProps) {
|
||||
const pathname = usePathname()
|
||||
@@ -62,6 +67,10 @@ export function MainNav({
|
||||
},
|
||||
]
|
||||
|
||||
const displayName = user?.name || user?.email?.split('@')[0] || 'Kullanıcı'
|
||||
const displayEmail = user?.email || ''
|
||||
const initial = displayName.charAt(0).toUpperCase()
|
||||
|
||||
return (
|
||||
<nav
|
||||
className={cn("flex flex-col space-y-2 py-4", className)}
|
||||
@@ -96,11 +105,11 @@ export function MainNav({
|
||||
<div className="px-4 mt-auto pt-4 border-t">
|
||||
<div className="flex items-center gap-3 mb-4 p-2 rounded-lg bg-muted/50">
|
||||
<div className="h-8 w-8 rounded-full bg-primary/20 flex items-center justify-center text-primary font-bold">
|
||||
A
|
||||
{initial}
|
||||
</div>
|
||||
<div className="flex-1 overflow-hidden">
|
||||
<p className="text-sm font-medium truncate">Admin User</p>
|
||||
<p className="text-xs text-muted-foreground truncate">admin@demo.com</p>
|
||||
<p className="text-sm font-medium truncate">{displayName}</p>
|
||||
<p className="text-xs text-muted-foreground truncate">{displayEmail}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -6,7 +6,7 @@ import { Menu } from "lucide-react"
|
||||
import { MainNav } from "@/components/main-nav"
|
||||
import { useState, useEffect } from "react"
|
||||
|
||||
export function MobileSidebar() {
|
||||
export function MobileSidebar({ user }: { user?: { name: string | null; email: string | null } }) {
|
||||
const [open, setOpen] = useState(false)
|
||||
const [isMounted, setIsMounted] = useState(false)
|
||||
|
||||
@@ -28,7 +28,7 @@ export function MobileSidebar() {
|
||||
</SheetTrigger>
|
||||
<SheetContent side="left" className="p-0 w-72">
|
||||
<SheetTitle className="sr-only">Navigasyon Menüsü</SheetTitle>
|
||||
<MainNav onNavClick={() => setOpen(false)} />
|
||||
<MainNav user={user} onNavClick={() => setOpen(false)} />
|
||||
</SheetContent>
|
||||
</Sheet>
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user