···
<Show when={followRecords.length}>
<div class="flex flex-row flex-wrap gap-x-5 gap-y-2">
-
<div class="flex h-6 items-center">
-
class="h-4 w-4 rounded border-gray-400 text-indigo-600 focus:ring-indigo-600"
-
selectRecords(RepoStatus.DELETED, e.currentTarget.checked)
-
<label for="deleted" class="ml-2 select-none">
-
<div class="flex h-6 items-center">
-
class="h-4 w-4 rounded border-gray-400 text-indigo-600 focus:ring-indigo-600"
-
selectRecords(RepoStatus.DEACTIVATED, e.currentTarget.checked)
-
<label for="deactivated" class="ml-2 select-none">
-
<div class="flex h-6 items-center">
-
class="h-4 w-4 rounded border-gray-400 text-indigo-600 focus:ring-indigo-600"
-
selectRecords(RepoStatus.SUSPENDED, e.currentTarget.checked)
-
<label for="suspended" class="ml-2 select-none">
-
<div class="flex h-6 items-center">
-
class="h-4 w-4 rounded border-gray-400 text-indigo-600 focus:ring-indigo-600"
-
selectRecords(RepoStatus.BLOCKEDBY, e.currentTarget.checked)
-
<label for="blockedby" class="ml-2 select-none">
-
<div class="flex h-6 items-center">
-
class="h-4 w-4 rounded border-gray-400 text-indigo-600 focus:ring-indigo-600"
-
selectRecords(RepoStatus.BLOCKING, e.currentTarget.checked)
-
<label for="blocking" class="ml-2 select-none">
···
+
const options: Record<string, { status: RepoStatus; label: string }> = {
+
status: RepoStatus.DELETED,
+
status: RepoStatus.DEACTIVATED,
+
status: RepoStatus.SUSPENDED,
+
status: RepoStatus.BLOCKEDBY,
+
status: RepoStatus.BLOCKING,
<Show when={followRecords.length}>
<div class="flex flex-row flex-wrap gap-x-5 gap-y-2">
+
<For each={Object.keys(options)}>
+
<div class="flex h-6 items-center">
+
class="h-4 w-4 rounded border-gray-400 text-indigo-600 focus:ring-indigo-600"
+
options[option].status,
+
e.currentTarget.checked,
+
<label for={option} class="ml-2 select-none">
+
{options[option].label}