Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | import { useAuthenticatedContext } from '@amalia/kernel/auth/state'; import { useLtiPlanSharePriceByGrantType } from '@amalia/lti/state'; import { type LtiPlan } from '@amalia/lti/types'; export const useCurrencySymbolForPlan = (ltiGrantType?: LtiPlan['grantType'] | null) => { const { data: sharePrice } = useLtiPlanSharePriceByGrantType(); const { authenticatedContext } = useAuthenticatedContext(); if (!ltiGrantType) { return authenticatedContext.user.company.currency; } return sharePrice?.[ltiGrantType]?.currency || authenticatedContext.user.company.currency; }; |