import { getSettings } from '@/actions/getSettings';
import { Footer } from '@/components/Footer';

export type DefaultFooterProps = {
    searchParams?: Promise<{ IPCountry?: string }>;
};

export default async function DefaultFooter(props: DefaultFooterProps) {
    const searchParams = await props.searchParams;
    const res = await getSettings({ IPCountry: searchParams?.IPCountry });

    if (res.error) return null;

    return (
        <Footer
            legalEntity={res.data?.legalEntity}
            links={res.data?.privacyLinks}
        />
    );
}
