feat: add skill packs management with support for category, risk, and source fields

This commit is contained in:
Abhimanyu Saharan
2026-02-14 03:30:13 +05:30
committed by Abhimanyu Saharan
parent da6cc2544b
commit 10748f71a8
11 changed files with 522 additions and 490 deletions

View File

@@ -90,6 +90,25 @@ export default function SkillsPacksPage() {
deleteMutation.mutate({ packId: deleteTarget.id });
};
const handleSyncPack = async (pack: SkillPackRead) => {
setSyncingPackIds((previous) => {
const next = new Set(previous);
next.add(pack.id);
return next;
});
try {
await syncMutation.mutateAsync({
packId: pack.id,
});
} finally {
setSyncingPackIds((previous) => {
const next = new Set(previous);
next.delete(pack.id);
return next;
});
}
};
return (
<>
<DashboardPageLayout
@@ -125,24 +144,7 @@ export default function SkillsPacksPage() {
canSync
syncingPackIds={syncingPackIds}
onSync={(pack) => {
void (async () => {
setSyncingPackIds((previous) => {
const next = new Set(previous);
next.add(pack.id);
return next;
});
try {
await syncMutation.mutateAsync({
packId: pack.id,
});
} finally {
setSyncingPackIds((previous) => {
const next = new Set(previous);
next.delete(pack.id);
return next;
});
}
})();
void handleSyncPack(pack);
}}
onDelete={setDeleteTarget}
emptyState={{