import { ChevronUp, ChevronDown, ChevronsUp, ChevronsDown, Lock } from 'lucide-react' import { useTranslation } from '../../../i18n' import { useMobileNavEditor, type MobileNavValue, type NavZone } from '../../../components/Settings/useMobileNavEditor' import { MOBILE_NAV_MAX_BAR, type NavItemDef } from '../../../components/Layout/navItems' import MobileNavPreview from '../../../components/Settings/MobileNavPreview' /** * Mobile customizer for the bottom navbar. Same model as the desktop version but * reorder + zone changes are button-driven (native drag never fires on touch, * #1432) and styled with the mobile `m-*` tokens. Dashboard stays pinned first. */ export default function MMobileNavCustomizer({ value, onChange, }: { value: MobileNavValue onChange: (next: MobileNavValue) => void }) { const { t } = useTranslation() const ed = useMobileNavEditor(value, onChange) const roundBtn = 'flex h-[30px] w-[30px] flex-none items-center justify-center rounded-full bg-[color:var(--m-ic)] text-m-ink disabled:opacity-35' const iconTile = (item: NavItemDef) => { const Icon = item.icon return ( ) } // Inline render helper (not a nested component) so rows re-render in place. const renderRow = (item: NavItemDef, index: number, zone: NavZone, count: number) => (
{iconTile(item)} {item.label}
) return (

{t('settings.appearance.mobileNav.hint')}

{t('settings.appearance.mobileNav.inBar')} {ed.barItems.length + 1}/{MOBILE_NAV_MAX_BAR + 1}
{ed.dashboard && (
{iconTile(ed.dashboard)} {ed.dashboard.label} {t('settings.appearance.mobileNav.pinned')}
)} {ed.barItems.map((item, i) => renderRow(item, i, 'bar', ed.barItems.length))}
{t('settings.appearance.mobileNav.underMore')}
{ed.moreItems.length === 0 ? (

{t('settings.appearance.mobileNav.moreEmpty')}

) : (
{ed.moreItems.map((item, i) => renderRow(item, i, 'more', ed.moreItems.length))}
)}
) }