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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user