Refactor BlocklistsPage into section components and fix frontend lint issues

This commit is contained in:
2026-03-22 14:08:20 +01:00
parent 99fbddb0e7
commit a1f97bd78f
8 changed files with 766 additions and 899 deletions

View File

@@ -115,7 +115,7 @@ const useStyles = makeStyles({
/** A row item augmented with an `onUnban` callback for the row action. */
interface BanRow {
ban: ActiveBan;
onUnban: (ip: string) => void;
onUnban: (ip: string) => Promise<void>;
}
const columns: TableColumnDefinition<BanRow>[] = [
@@ -168,9 +168,7 @@ const columns: TableColumnDefinition<BanRow>[] = [
size="small"
appearance="subtle"
icon={<DismissRegular />}
onClick={() => {
onUnban(ban.ip);
}}
onClick={() => { void onUnban(ban.ip); }}
aria-label={`Unban ${ban.ip}`}
/>
</Tooltip>
@@ -195,8 +193,8 @@ export interface BannedIpsSectionProps {
onSearch: (term: string) => void;
onPageChange: (page: number) => void;
onPageSizeChange: (size: number) => void;
onRefresh: () => void;
onUnban: (ip: string) => void;
onRefresh: () => Promise<void>;
onUnban: (ip: string) => Promise<void>;
}
// ---------------------------------------------------------------------------
@@ -247,7 +245,7 @@ export function BannedIpsSection({
size="small"
appearance="subtle"
icon={<ArrowClockwiseRegular />}
onClick={onRefresh}
onClick={() => { void onRefresh(); }}
aria-label="Refresh banned IPs"
/>
</div>