15 lines
392 B
TypeScript
15 lines
392 B
TypeScript
import {useMemo} from 'react'
|
|
|
|
import {useGate} from '#/lib/statsig/statsig'
|
|
import {useGeolocation} from '#/state/geolocation'
|
|
|
|
export function useIsAgeAssuranceEnabled() {
|
|
const gate = useGate()
|
|
const {geolocation} = useGeolocation()
|
|
|
|
return useMemo(() => {
|
|
const enabled = gate('age_assurance')
|
|
return enabled && !!geolocation?.isAgeRestrictedGeo
|
|
}, [geolocation, gate])
|
|
}
|