Rename useAgeAssurance

This commit is contained in:
Eric Bailey
2025-07-15 17:06:34 -05:00
parent 659e62ccc3
commit 6ac8b47b57
6 changed files with 17 additions and 17 deletions
@@ -7,7 +7,7 @@ import {usePreferencesQuery} from '#/state/queries/preferences'
const logger = Logger.create(Logger.Context.AgeAssurance)
type AgeInfo = {
type AgeAssurance = {
isReady: boolean
declaredAge: number | undefined
isUnderage: boolean
@@ -20,7 +20,7 @@ type AgeInfo = {
* declared age. Use this instead of {@link useAgeAssuranceContext} to get a
* more user-friendly interface.
*/
export function useAgeInfo(): AgeInfo {
export function useAgeAssurance(): AgeAssurance {
const ctx = useAgeAssuranceContext()
const {isAgeRestricted} = useIsAgeRestricted()
const {isFetched: preferencesLoaded, data: preferences} =
@@ -30,7 +30,7 @@ export function useAgeInfo(): AgeInfo {
return useMemo(() => {
const isReady = ctx.isReady && preferencesLoaded
const isUnderage = (declaredAge || 0) < 18
const info: AgeInfo = {
const state: AgeAssurance = {
isReady,
declaredAge,
isUnderage,
@@ -38,7 +38,7 @@ export function useAgeInfo(): AgeInfo {
assurance: ctx,
}
logger.debug(`useAgeInfo`, info)
return info
logger.debug(`state`, state)
return state
}, [ctx, preferencesLoaded, declaredAge, isAgeRestricted])
}