=> {
setError(null);
try {
const result = await post<{ notices: PluginNotice[] }>(`/notices/${notice.id}/dismiss`);
setState({ ...state, notices: result.notices });
} catch (caught) {
// The notice stays, and says why.
setError(caught);
}
};
if (!state.notices.length) return null;
return (
{state.notices.map((notice) => (
void dismiss(notice)}
actions={notice.action ? [{ label: notice.action.label, onClick: noticeAction(notice.action.kind), variant: 'link' }] : []}
>
{notice.message}
))}
);
}
function Screen() {
const { boot, connected } = useApp();
const query = useQuery();
switch (boot.screen) {
case 'standins':
return ;
case 'knowledge':
return ;
case 'widget':
return ;
case 'settings':
return ;
case 'overview':
case 'welcome':
default:
return connected ? : ;
}
}
function Root() {
const { settingsError } = useApp();
return (
{settingsError ? (
) : null}
);
}
export function App() {
return (
);
}