Unfollow tool for Bluesky

add selection of all accounts of a given status

Changed files
+35 -7
src
+35 -7
src/App.tsx
···
});
};
+
function selectRecords(status: RepoStatus) {
+
followRecords.forEach((record, index) => {
+
if (record.status == status)
+
setFollowRecords(index, "toBeDeleted", record.toBeDeleted ? false : true);
+
});
+
}
+
const fetchHiddenAccounts = async (handle: string, password: string) => {
const serviceURL = await fetchServiceEndpoint(handle);
···
<input
type="checkbox"
id="delete"
+
checked={record.toBeDeleted}
onChange={(e) =>
setFollowRecords(
index(),
···
)
}
/>
-
<div>{record.handle}</div>
-
<Show when={record.toBeDeleted}>
-
<div>TO DELETE</div>
-
</Show>
-
<div>
+
<span>{record.handle} </span>
+
<span>
<Switch>
<Match when={record.status == RepoStatus.DELETED}>
Deleted
···
Suspended
</Match>
</Switch>
-
</div>
-
<div>{record.did}</div>
+
</span>
+
<span> {record.did}</span>
</div>
</Show>
)}
···
>
Preview
</button>
+
<div>
+
<button type="button" onclick={() => selectRecords(RepoStatus.DELETED)}>
+
Deleted
+
</button>
+
<button
+
type="button"
+
onclick={() => selectRecords(RepoStatus.DEACTIVATED)}
+
>
+
Deactivated
+
</button>
+
<button
+
type="button"
+
onclick={() => selectRecords(RepoStatus.BLOCKEDBY)}
+
>
+
Blocked By
+
</button>
+
<button
+
type="button"
+
onclick={() => selectRecords(RepoStatus.SUSPENDED)}
+
>
+
Suspended
+
</button>
+
</div>
</div>
);
};