Function: useEndorsements()
useEndorsements(
eprintUri,params,options):UseQueryResult<OutputSchema,Error>
Defined in: web/lib/hooks/use-endorsement.ts:189
Fetches endorsements for an eprint.
Parameters
eprintUri
string
AT-URI of the eprint
params
EndorsementListParams = {}
Query parameters (limit, cursor, contributionType)
options
UseEndorsementsOptions = {}
Hook options
Returns
UseQueryResult<OutputSchema, Error>
Query result with endorsements data
Remarks
Returns endorsements with aggregated counts by contribution type. Uses a 2-minute stale time as endorsements change less frequently than reviews.
Example
const { data, isLoading, error } = useEndorsements(eprintUri);
if (isLoading) return <EndorsementPanelSkeleton />;
return (
<EndorsementPanel
endorsements={data.endorsements}
summary={data.summary}
/>
);
Throws
When the endorsements API request fails