"use client"

import Image from "next/image";
import { Link, usePathname } from "@/i18n/navigation";
import { useLocale } from "next-intl";

import {
  Sidebar,
  SidebarContent,
  SidebarHeader,
} from "@/components/ui/sidebar";
import { Navigations } from "./navigations";

export function AppSidebar({ ...props }: React.ComponentProps<typeof Sidebar>) {
  const locale = useLocale();
  const pathname = usePathname();
  if (pathname.includes("fullscreen") || pathname.includes("profile")) return null;
  return (
    <Sidebar collapsible="icon" {...props} side={locale === "ar" ? "right" : "left"}>
      <SidebarHeader className="bg-primary-tw-400">
        <Link href={'/'} className="h-12 w-full">
          <Image
            src={'/images/logo.png'}
            alt="mwaheb"
            className="object-cover h-12"
            width={200}
            height={200}
            priority
          />
        </Link>
      </SidebarHeader>
      <SidebarContent className="bg-zinc-50 text-black pt-4">
        <Navigations />
      </SidebarContent>
      {/* <SidebarFooter>
        <NavUser user={data.user} />
      </SidebarFooter> */}
      {/* <SidebarRail /> */}
    </Sidebar>
  )
}
