import { NavLink, Outlet, useLocation } from "react-router-dom";
import { useAuth } from "@/features/auth/AuthProvider";
import { Icon, type IconName } from "@/components/Icon";
import { Ltr } from "@/components/ui";
import { t } from "@/strings/ar";
import AnnouncementBar from "@/components/AnnouncementBar";
/* The rail, per ContiAI App.dc.html.
*
* It is a dark navy panel rather than a light one, which is the single change
* that gives the product its shape: the page floats as one bright field beside
* a fixed dark edge, and the active item - brand fill on navy - is legible at
* a glance.
*
* The page is RTL, so the first element in a flex row lands on the RIGHT. The
* rail is therefore first in the DOM; putting the main region first pushed the
* navigation to the left, which is wrong for Arabic.
*/
interface NavItem {
to: string;
label: string;
icon: IconName;
end?: boolean;
}
const NAV: NavItem[] = [
{ to: "/", label: t.nav.home, icon: "home", end: true },
{ to: "/create", label: t.nav.create, icon: "sparkle" },
{ to: "/library", label: t.nav.library, icon: "book" },
{ to: "/usage", label: t.nav.usage, icon: "clock" },
];
/** The founder's bag designer - shown to the owner account only. */
const DESIGN: NavItem = { to: "/design", label: "تصميم الحقائب والعروض", icon: "layers" };
/** «استوديو التصميم» - social designs and infographics, the owner account only. */
const STUDIO: NavItem = { to: "/studio", label: "استوديو التصميم", icon: "infographic" };
const FOOT: NavItem[] = [
{ to: "/profile", label: "الملف الشخصي", icon: "user" },
{ to: "/settings", label: t.nav.settings, icon: "cog" },
];
/** A rail row. Everything it wears is a rail token - none of the page's text
* or surface roles read correctly against navy. */
function Item({ item }: { item: NavItem }) {
return (