import type { LucideIcon } from 'lucide-react'; import { ChevronLeft } from 'lucide-react'; import type { ReactNode } from 'react'; export interface MSection { id: string; label: string; icon: LucideIcon; } interface MSectionRowProps { section: MSection; active: boolean; /** Marks the row as the page on show, for the list that stands beside the page. */ current?: boolean; onPick: () => void; } /** One section of a settings-like screen, in its dropdown or in the list beside the page. */ export function MSectionRow({ section, active, current = false, onPick }: MSectionRowProps) { return ( ); } /** * The frame of a settings-like screen (settings, administration), one rule for * both: the page column on a phone, a centred column on a wide window, and from * the split size class the list of sections beside a page that runs to the same * width on both screens. */ export const SECTION_SCREEN = 'px-4 pb-[calc(var(--bottom-nav-h,84px)+16px)] pt-[var(--m-safe-top,12px)] wide:mx-auto wide:max-w-[1040px] wide:px-6 split:grid split:max-w-[1240px] split:grid-cols-[260px_minmax(0,1fr)] split:items-start split:gap-8'; interface MSectionNavProps { title: string; backLabel: string; onBack: () => void; sections: MSection[]; activeId: string; onPick: (id: string) => void; /** * An action of the screen (admin: a new user), on a line of its own under the * title, so a long title in a long language keeps the whole width. */ action?: ReactNode; } /** * The sections of a settings-like screen (settings, administration) as a list * of their own beside the page, the way Settings on an iPad shows them, once * the window has room for two panes. It stays in view while the page scrolls. * Narrower windows keep the dropdown in the screen's header. */ export default function MSectionNav({ title, backLabel, onBack, sections, activeId, onPick, action, }: MSectionNavProps) { return ( ); }