blob: f10d1ef5a45561e8f8ef3c3e9b7b486449472545 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
import { useFonts } from 'expo-font';
import { DMSans_300Light, DMSans_400Regular, DMSans_600SemiBold, DMSans_700Bold } from '@expo-google-fonts/dm-sans';
import { calcularSalarioLiquido, type ResultadoCalculo } from '@/utils/tax-calculator';
export function useAppFonts() {
const [loaded, error] = useFonts({
DMSans_300Light,
DMSans_400Regular,
DMSans_600SemiBold,
DMSans_700Bold,
});
return { fontsLoaded: loaded, fontsError: error };
}
export function useSalaryCalculator(grossSalaryStr: string): ResultadoCalculo | null {
const value = parseFloat(grossSalaryStr.replace(',', '.'));
if (isNaN(value) || value <= 0) return null;
return calcularSalarioLiquido(value);
}
|