Function: useEndorsementSummary()
useEndorsementSummary(
preprintUri,options):UseQueryResult<{byType: {};endorserCount:number;total:number; },Error>
Defined in: web/lib/hooks/use-endorsement.ts:240
Fetches only the endorsement summary (counts by contribution type).
Parameters
preprintUri
string
AT-URI of the preprint
options
UseEndorsementsOptions = {}
Hook options
Returns
UseQueryResult<{ byType: {}; endorserCount: number; total: number; }, Error>
Query result with endorsement summary
Remarks
Lightweight query that returns just the counts without full endorsement data. Useful for displaying badges/counts in preprint cards.
Example
const { data: summary } = useEndorsementSummary(preprintUri);
return (
<EndorsementBadges
byType={summary?.byType}
total={summary?.total ?? 0}
endorserCount={summary?.endorserCount ?? 0}
/>
);