mirror of
https://github.com/hanzoai/sentinel.git
synced 2026-09-29 22:34:33 +00:00
29 lines
778 B
TypeScript
29 lines
778 B
TypeScript
import {useMemo} from 'react';
|
|
|
|
import useReplayCount from 'sentry/utils/replayCount/useReplayCount';
|
|
import useOrganization from 'sentry/utils/useOrganization';
|
|
|
|
/**
|
|
* Query results for whether a Transaction has replays associated.
|
|
*/
|
|
export default function useReplayCountForTransactions() {
|
|
const organization = useOrganization();
|
|
const {getOne, getMany, hasOne, hasMany} = useReplayCount({
|
|
bufferLimit: 25,
|
|
dataSource: 'discover',
|
|
fieldName: 'transaction',
|
|
organization,
|
|
statsPeriod: '90d',
|
|
});
|
|
|
|
return useMemo(
|
|
() => ({
|
|
getReplayCountForTransaction: getOne,
|
|
getReplayCountForTransactions: getMany,
|
|
transactionHasReplay: hasOne,
|
|
transactionsHaveReplay: hasMany,
|
|
}),
|
|
[getMany, getOne, hasMany, hasOne]
|
|
);
|
|
}
|