"use client";
import { PanelLeft, PanelLeftClose } from "lucide-react";
import { useTranslations } from "next-intl";
import { Button } from "@/components/ui/button";
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
import { usePlatformShortcut } from "@/hooks/use-platform-shortcut";
interface SidebarCollapseButtonProps {
isCollapsed: boolean;
onToggle: () => void;
disableTooltip?: boolean;
}
export function SidebarCollapseButton({
isCollapsed,
onToggle,
disableTooltip = false,
}: SidebarCollapseButtonProps) {
const t = useTranslations("sidebar");
const { shortcut } = usePlatformShortcut();
const button = (
);
if (disableTooltip) {
return button;
}
return (
{button}
{isCollapsed
? `${t("expand_sidebar")} ${shortcut("Mod", "\\")}`
: `${t("collapse_sidebar")} ${shortcut("Mod", "\\")}`}
);
}