2025-01-24 17:24:45 -05:00
|
|
|
"use client"
|
|
|
|
|
|
|
|
import Link from "next/link"
|
|
|
|
import { Button } from "@/components/ui/button"
|
|
|
|
import { X } from "lucide-react"
|
|
|
|
import { useSidebar } from "@/context/SidebarContext"
|
2025-01-30 19:59:24 -05:00
|
|
|
import strings from "@/strings.json"
|
2025-01-24 17:24:45 -05:00
|
|
|
|
|
|
|
export function MobileAdminSidebar() {
|
|
|
|
const { isOpen, toggleSidebar } = useSidebar()
|
|
|
|
|
|
|
|
return (
|
|
|
|
<aside
|
|
|
|
className={`fixed inset-y-0 left-0 z-30 w-64 transform overflow-y-auto bg-background px-4 py-6 transition-transform duration-300 ease-in-out ${
|
|
|
|
isOpen ? "translate-x-0" : "-translate-x-full"
|
|
|
|
}`}
|
|
|
|
>
|
|
|
|
<div className="flex items-center justify-between mb-6 mt-12">
|
|
|
|
<Link href="/" className="text-4xl font-bold text-primary">
|
2025-01-30 19:59:24 -05:00
|
|
|
{process.env.BLOG_NAME || strings.blogPop}
|
2025-01-24 17:24:45 -05:00
|
|
|
</Link>
|
|
|
|
<Button variant="ghost" size="icon" onClick={toggleSidebar} className="md:hidden">
|
|
|
|
<X className="h-6 w-6" />
|
2025-01-30 19:59:24 -05:00
|
|
|
<span className="sr-only">{strings.screenReaderCloseSidebar}</span>
|
2025-01-24 17:24:45 -05:00
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
<nav className="flex flex-col space-y-4">
|
|
|
|
<Link href="/admin" className="text-lg text-muted-foreground hover:text-primary">
|
2025-01-30 19:59:24 -05:00
|
|
|
{strings.adminSidebarDashboardLinkText}
|
2025-01-24 17:24:45 -05:00
|
|
|
</Link>
|
|
|
|
<Link href="/admin/posts" className="text-lg text-muted-foreground hover:text-primary">
|
2025-01-30 19:59:24 -05:00
|
|
|
{strings.adminSidebarPostsLinkText}
|
2025-01-24 17:24:45 -05:00
|
|
|
</Link>
|
|
|
|
<Link href="/admin/users" className="text-lg text-muted-foreground hover:text-primary">
|
2025-01-30 19:59:24 -05:00
|
|
|
{strings.adminSidebarUsersLinkText}
|
2025-01-24 17:24:45 -05:00
|
|
|
</Link>
|
|
|
|
<Link href="/admin/logout" className="text-lg text-muted-foreground hover:text-primary">
|
2025-01-30 19:59:24 -05:00
|
|
|
{strings.adminSidebarLogoutLinkText}
|
2025-01-24 17:24:45 -05:00
|
|
|
</Link>
|
|
|
|
</nav>
|
|
|
|
</aside>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|