"use client"; import { AnimatePresence, motion, useReducedMotion } from "framer-motion"; import { ShieldCheck, SlidersHorizontal, X } from "lucide-react"; import { useTranslations } from "next-intl"; import { useState, type ReactNode } from "react"; import { LocaleToggle } from "@/components/layout/locale-toggle"; import { SoundToggle } from "@/components/sound-toggle"; import { ThemeToggle } from "@/components/theme-toggle"; import { buildAdminUrl } from "@/lib/admin-routing"; import type { AppLocale } from "@/lib/locale"; import { cn } from "@/lib/utils"; type FloatingControlsProps = { locale: string; defaultLocale: AppLocale; isSuperAdmin?: boolean; }; const pill = "flex h-11 w-11 items-center justify-center rounded-full border border-border/60 bg-background/80 text-foreground/80 shadow-panel backdrop-blur-chrome transition-colors hover:bg-accent hover:text-foreground"; const itemVariants = { hidden: { opacity: 0, y: 12, scale: 0.8 }, show: { opacity: 1, y: 0, scale: 1 }, }; export function FloatingControls({ locale, defaultLocale, isSuperAdmin = false, }: FloatingControlsProps) { const [open, setOpen] = useState(false); const t = useTranslations("navigation"); const reducedMotion = useReducedMotion(); const controls: ReactNode[] = [ , , , ]; if (isSuperAdmin) { controls.push( , ); } return (
{open ? ( {controls.map((control, index) => ( {control} ))} ) : null}
); }