function AppLayout({
view,
tagView,
setView,
tags,
unread,
total,
status,
qInput,
setQInput,
onSearch,
items,
selected,
setSelected,
loading,
checked,
setChecked,
selectAllPages,
setSelectAllPages,
onCreateTag,
onRenameTag,
onDeleteTag,
onBulk,
onMarkAll,
msg,
msgTags,
attachments,
token,
archived,
busy,
onToggleUnread,
onStar,
onArchive,
onUnarchive,
onDelete,
onReply,
offset,
setOffset,
pageSize,
account,
onLogout,
composeOpen,
brand,
onBack,
setComposeOpen,
sendAddresses,
onCompose,
}) {
const { t } = useI18n();
// Below md the three panes do not fit side by side: the sidebar becomes a
// drawer, and the list and the message take turns on the full width.
const [navOpen, setNavOpen] = React.useState(false);
const showPane = !!msg;
const pages = Math.max(1, Math.ceil(total / pageSize));
const page = Math.floor(offset / pageSize) + 1;
return (
{viewLabel(view, tagView, t)}
{total}
{navOpen && (
setNavOpen(false)}
/>
)}
{ setView(v, tag); setNavOpen(false); }}
tags={tags}
unread={unread}
total={total}
status={status}
onCreateTag={onCreateTag}
onRenameTag={onRenameTag}
onDeleteTag={onDeleteTag}
onLogout={onLogout}
token={token}
account={account}
onComposeClick={() => { setComposeOpen(true); setNavOpen(false); }}
brand={brand}
onCloseNav={() => setNavOpen(false)}
/>
{viewLabel(view, tagView, t)}
{page}/{pages}
setComposeOpen(false)}
onSend={onCompose}
addresses={sendAddresses}
defaultFrom={account?.address || (sendAddresses || [])[0] || ""}
token={token}
busy={busy}
/>
);
}