{current &&
setSearch(data.value)}/>}
{current ? <>
{tab === 'items' && <>
{/* Portrait mobile: condensed, read-only. Rotate to landscape (tablet+) for the full editor. */}
{/* The table gets the FULL items (so edits/adds don't drop filtered-out rows) plus the search,
which it applies to its displayed rows only. */}
persistInventory(slug, {items: newItems})}/>
>}
{tab === 'summary' && }
{tab === 'export' &&
}
{/* Always mounted (hidden on screen) so the browser print dialog has the full table + summary to render. */}
setEditFieldsOpen(false)}
onSave={newFields => persistInventory(slug, {fields: newFields})}/>
> :