feat: add shared setup viewer with token detection and read-only mode

Detect ?share=token query param on setup detail page, fetch via
/api/shared/:token, and display read-only view with "Shared setup"
banner. Hide all owner controls (add items, share, delete, classification)
in shared view. Show "Link not available" error for invalid tokens.

Plan: 32-04 (Setup Sharing System - Shared Setup Viewer)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
makiolajandClaude Opus 4.6 committed 2026-04-13 18:04:41 +02:00
1 parent a531581623
commit 0b46eff243
2 files changed
+68 -16

No files matched your search

+9
View File
@@ -74,6 +74,15 @@ export function usePublicSetup(setupId: number | null) {
});
}
export function useSharedSetup(token: string | null) {
return useQuery({
queryKey: ["shared-setup", token],
queryFn: () => apiGet<SetupWithItems>(`/api/shared/${token}`),
enabled: !!token,
retry: false,
});
}
export function useCreateSetup() {
const queryClient = useQueryClient();
return useMutation({