'use client';

import { Alert } from 'antd';
import {
    PREVEND_CLIENTE_BANNER_DESCRIPTION,
    PREVEND_CLIENTE_BANNER_TITLE,
} from '../kickoffCopy';

export type ProjetoPrevendaClienteBannerProps = {
    /** True quando já há cliente/carteira vinculado. */
    temCliente: boolean;
    /** Nome do prospect / pessoa do negócio, se conhecido. */
    prospectLabel?: string | null;
    style?: React.CSSProperties;
};

/**
 * N10 — na pré-venda sem cliente, deixa explícito que o vínculo é prospect.
 */
export function ProjetoPrevendaClienteBanner({
    temCliente,
    prospectLabel,
    style,
}: ProjetoPrevendaClienteBannerProps) {
    if (temCliente) return null;

    const description = prospectLabel?.trim()
        ? `${PREVEND_CLIENTE_BANNER_DESCRIPTION} Prospect atual: ${prospectLabel.trim()}.`
        : PREVEND_CLIENTE_BANNER_DESCRIPTION;

    return (
        <Alert
            type="info"
            showIcon
            style={{ marginBottom: 16, ...style }}
            message={PREVEND_CLIENTE_BANNER_TITLE}
            description={description}
            data-testid="crm-prevenda-cliente-banner"
        />
    );
}
