refactor(webui): adopt semantic workspace actions

This commit is contained in:
2026-08-19 18:47:46 +02:00
parent 89cc5f0189
commit 13bdeccdab
+12 -8
View File
@@ -1,7 +1,6 @@
import { CheckCircle2, Pencil, Plus, RefreshCw, ShieldCheck, XCircle } from "lucide-react";
import { CheckCircle2, Pencil, Plus, ShieldCheck, XCircle } from "lucide-react";
import { useCallback, useEffect, useMemo, useState } from "react";
import { ActionToolbar,
ActionBlockerHint,
import { ActionBlockerHint,
Button,
ConfirmDialog,
Dialog,
@@ -18,6 +17,7 @@ import { ActionToolbar,
SelectionListItemContent,
StatePanel,
StatusBadge,
WorkspaceActionBar,
WorkspaceLayout,
hasScope,
i18nMessage,
@@ -165,11 +165,15 @@ export default function VotingPage({ settings, auth }: PlatformRouteContext) {
helpContextId="voting.workspace"
helpModuleId="voting"
primary={<>
<ActionToolbar surface="panel-header" className="voting-toolbar">
<IconButton label="Refresh ballots" icon={<RefreshCw size={16} />} disabled={loading || busy} disabledReason={loading ? VOTING_I18N.loading : busy ? VOTING_I18N.busy : undefined} onClick={() => void loadList()} />
<Button variant="primary" disabled={!canManage} disabledReason={!canManage ? VOTING_I18N.manageReason : undefined} onClick={() => setEditing("new")}><Plus size={16} aria-hidden="true" />New ballot</Button>
<DocumentationHelpLink reference={VOTING_DOCUMENTATION} />
</ActionToolbar>
<WorkspaceActionBar
scope="collection-pane"
variant="collection"
refreshable
reloadAction={{ onReload: () => void loadList(), loading: loading || busy, label: "Refresh ballots" }}
className="voting-toolbar"
createAction={<Button variant="primary" disabled={!canManage} disabledReason={!canManage ? VOTING_I18N.manageReason : undefined} onClick={() => setEditing("new")}><Plus size={16} aria-hidden="true" />New ballot</Button>}
helpAction={<DocumentationHelpLink reference={VOTING_DOCUMENTATION} />}
/>
<PageScrollViewport className="voting-list-viewport">
{loading && <LoadingIndicator label="Loading ballots" />}
{!loading && items.length === 0 && <StatePanel size="compact" description="No ballots." />}