Refactor BlocklistsPage into section components and fix frontend lint issues
This commit is contained in:
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user