import { MenuButton, MenuItem, OverflowMenu, OverflowMenuItem } from "@carbon/react"; import { ChevronDown } from "@carbon/icons-react"; import type { ExportMode } from "../lib/filename"; import { EXPORT_MODE_LABEL, saveExportMode } from "../lib/exportMode"; const MODES: ExportMode[] = ["searchable", "flattened"]; /** "Export PDF" menu for an issued invoice. Choosing a mode also makes it the remembered one. */ export default function ExportButton({ onExport, disabled }: { onExport: (mode: ExportMode) => void; disabled?: boolean }) { return ( {MODES.map((mode) => ( { saveExportMode(mode); onExport(mode); }} /> ))} ); } /** The format the primary "Issue & export" action uses; a small menu next to that button. */ export function ExportModePicker({ mode, onChange, disabled }: { mode: ExportMode; onChange: (mode: ExportMode) => void; disabled?: boolean }) { return ( {MODES.map((m) => ( { saveExportMode(m); onChange(m); }} /> ))} ); }