<?php

use App\Models\Setting;

if (! function_exists('money')) {
    function money(float|int|string|null $amount): string
    {
        $symbol = Setting::get('currency_symbol', '₦');

        return $symbol.number_format((float) $amount, 2);
    }
}

if (! function_exists('platform_name')) {
    function platform_name(): string
    {
        return (string) Setting::get('company_short_name', Setting::get('company_name', 'Vantage Finance House'));
    }
}

if (! function_exists('platform_full_name')) {
    function platform_full_name(): string
    {
        return (string) Setting::get('company_name', 'Vantage Finance House');
    }
}

if (! function_exists('platform_tagline')) {
    function platform_tagline(): string
    {
        return (string) Setting::get('company_tagline', 'CBN Licensed · Abuja');
    }
}


if (! function_exists('platform_logo')) {
    /**
     * Brand asset URL.
     * @param  string  $kind  mark|logo|logo-light|logo-stacked
     */
    function platform_logo(string $kind = 'mark'): string
    {
        $map = [
            'mark' => 'images/brand/vantage-mark.svg',
            'mark-light' => 'images/brand/vantage-mark-light.svg',
            'logo' => 'images/brand/vantage-logo.svg',
            'logo-light' => 'images/brand/vantage-logo-light.svg',
            'logo-stacked' => 'images/brand/vantage-logo-stacked.svg',
            'favicon' => 'favicon.svg',
        ];

        return asset($map[$kind] ?? $map['mark']);
    }
}
