import { Droppable } from "@hello-pangea/dnd"; import { useTranslate } from "ra-core"; import { translateChoice } from "@/i18n/utils"; import { useConfigurationContext } from "../root/ConfigurationContext"; import type { Deal } from "../types"; import { DealCard } from "./DealCard"; export const DealColumn = ({ stage, deals, }: { stage: string; deals: Deal[]; }) => { const totalAmount = deals.reduce((sum, deal) => sum + deal.amount, 0); const { dealStages } = useConfigurationContext(); const translate = useTranslate(); const rawLabel = dealStages.find((dealStage) => dealStage.value === stage)?.label || stage; const label = translateChoice(translate, "crm.deal.stage", stage, rawLabel); return (
{totalAmount.toLocaleString("en-US", { notation: "compact", style: "currency", currency: "USD", currencyDisplay: "narrowSymbol", minimumSignificantDigits: 3, })}