(slug: string)
| 174 | // Viewer-scoped, so it must never be baked into the anonymous SSG payload; |
| 175 | // callers fetch this client-side only, gated to logged-in users. |
| 176 | export const getToolViewerCanClaim = async (slug: string): Promise<boolean> => { |
| 177 | const result = await gqlClient.request<{ |
| 178 | datasetTool: { viewerCanClaim: boolean }; |
| 179 | }>(TOOL_VIEWER_CAN_CLAIM_QUERY, { slug }); |
| 180 | return result.datasetTool.viewerCanClaim; |
| 181 | }; |
| 182 | |
| 183 | export interface ToolClaimResult { |
| 184 | claimedBy: ToolClaimedBy | null; |