// template/src/theme/FontLoader.tsx
import React, { useEffect } from "react";
import * as Font from "expo-font";

import GTUltraStandardRegular from "../../assets/brands/lloyds/fonts/GT-Ultra-Standard-Regular.ttf";
import GTUltraStandardBold from "../../assets/brands/lloyds/fonts/GT-Ultra-Standard-Bold.ttf";
import GTUltraMedianRegular from "../../assets/brands/lloyds/fonts/GT-Ultra-Median-Regular.ttf";
import GTUltraMedianBold from "../../assets/brands/lloyds/fonts/GT-Ultra-Median-Bold.ttf";

interface FontLoaderProps {
    children: React.ReactNode;
}

export const FontLoader: React.FC<FontLoaderProps> = ({ children }) => {
    useEffect(() => {
        Font.loadAsync({
            "GT-Ultra-Standard-Regular": GTUltraStandardRegular,
            "GT-Ultra-Standard-Bold": GTUltraStandardBold,
            "GT-Ultra-Median-Regular": GTUltraMedianRegular,
            "GT-Ultra-Median-Bold": GTUltraMedianBold,
        }).catch((err) => {
            console.warn("Font loading error:", err);
        });
    }, []);

    return <>{children}</>;
};