import { AuctionFormat, type AuctionFormat as AuctionFormatValue } from '@/enums/auctionFormat';

export function auctionBidHistoryDialogLabel(auctionId: number, format: AuctionFormatValue): string {
    const typeLabel = format === AuctionFormat.Online ? 'Online Auction' : 'In-Person Auction';

    return `${typeLabel} #${auctionId}`;
}

export function formatCurrency(value: string | number | null | undefined): string {
    if (value === null || value === undefined || value === '') {
        return '-';
    }

    return `$${Number(value).toLocaleString(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 })}`;
}

export function formatOdometerKm(value: number | null | undefined): string {
    if (value === null || value === undefined) {
        return '-';
    }

    return `${value.toLocaleString('en-AU')} km`;
}
