export function formatZero(
    amount: number,
    currency: string,
    mode: string,
    formatMinor: (n: number, c: string) => string,
): string | null {
    if (amount !== 0) {
        return formatMinor(amount, currency);
    }

    if (mode === 'hidden') {
        return null;
    }

    if (mode === 'free') {
        return 'Gratuit';
    }

    return formatMinor(0, currency);
}

export function cycleLabel(months: number): string {
    if (months === 1) {
        return 'Mensuel';
    }

    if (months === 3) {
        return 'Trimestriel';
    }

    if (months === 6) {
        return 'Semestriel';
    }

    if (months === 12) {
        return 'Annuel';
    }

    if (months === 24) {
        return 'Biennal';
    }

    if (months % 12 === 0) {
        return `${months / 12} ans`;
    }

    return `${months} mois`;
}
