Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Fix some translation messages appear in the UI

fzaninotto3300c499ad81
diff --git a/src/components/atomic-crm/companies/CompanyCard.tsx b/src/components/atomic-crm/companies/CompanyCard.tsx
index b75982e7..7d608528 100644
--- a/src/components/atomic-crm/companies/CompanyCard.tsx
+++ b/src/components/atomic-crm/companies/CompanyCard.tsx
@@ -55,7 +55,7 @@ export const CompanyCard = (props: { record?: Company }) => {
<span className="text-sm font-medium">{record.nb_deals}</span>
<span className="text-xs text-muted-foreground">
{translate("resources.deals.name", {
- smart_count: record.nb_deals,
+ smart_count: record.nb_deals ?? 0,
_: "Deal |||| Deals",
})}
</span>
diff --git a/src/components/atomic-crm/companies/CompanyShow.tsx b/src/components/atomic-crm/companies/CompanyShow.tsx
index a0375b46..c3fd107f 100644
--- a/src/components/atomic-crm/companies/CompanyShow.tsx
+++ b/src/components/atomic-crm/companies/CompanyShow.tsx
@@ -126,13 +126,13 @@ const CompanyShowContent = () => {
{record.nb_contacts === 0
? translate("resources.companies.no_contacts")
: translate("resources.companies.nb_contacts", {
- smart_count: record.nb_contacts,
+ smart_count: record.nb_contacts ?? 0,
})}
</TabsTrigger>
{record.nb_deals ? (
<TabsTrigger value="deals">
{translate("resources.companies.nb_deals", {
- smart_count: record.nb_deals,
+ smart_count: record.nb_deals ?? 0,
})}
</TabsTrigger>
) : null}
@@ -216,7 +216,7 @@ const ContactsIterator = () => {
{contact.title}
{contact.nb_tasks
? ` - ${translate("crm.common.task_count", {
- smart_count: contact.nb_tasks,
+ smart_count: contact.nb_tasks ?? 0,
})}`
: ""}
&nbsp; &nbsp;
diff --git a/src/components/atomic-crm/contacts/ContactShow.tsx b/src/components/atomic-crm/contacts/ContactShow.tsx
index 0de11f7f..e03d066a 100644
--- a/src/components/atomic-crm/contacts/ContactShow.tsx
+++ b/src/components/atomic-crm/contacts/ContactShow.tsx
@@ -137,7 +137,7 @@ const ContactShowContentMobile = () => {
</TabsTrigger>
<TabsTrigger value="tasks">
{translate("crm.common.task_count", {
- smart_count: taskCount,
+ smart_count: taskCount ?? 0,
})}
</TabsTrigger>
<TabsTrigger value="details">