Merge pull request #1164 from Tria-plc/freight/nati-2

Freight/nati 2
This commit is contained in:
Nathnael Wondisha
2026-08-07 15:58:02 +03:00
committed by GitHub
26 changed files with 786 additions and 52 deletions

View File

@@ -16,6 +16,7 @@ import { FREIGHT_PERMS, hasPermission } from "@/lib/permissions";
import { api } from "@/services/api";
import type {
CompanyNationality,
CompanyProfile,
CompanyStatus,
CompanyType,
@@ -88,6 +89,31 @@ export function CompanyTypeBadge({ type }: { type: CompanyType }) {
);
}
const NATIONALITY_COLOR: Record<CompanyNationality, string> = {
ethiopian: "edr-green",
foreign: "blue",
};
export function CompanyNationalityBadge({
nationality,
}: {
nationality?: CompanyNationality | null;
}) {
if (!nationality) return null;
return (
<Badge
color={NATIONALITY_COLOR[nationality] ?? "gray"}
variant="light"
size="sm"
radius="md"
fw={600}
style={badgeStyle}
>
{humanize(nationality)}
</Badge>
);
}
/**
* Profile chips for a company row: one chip per role (Importer / Exporter / …)
* carrying its reference code. Caps at three (a company has at most three

View File

@@ -1,5 +1,6 @@
export {
BookingStatusBadge,
CompanyNationalityBadge,
CompanyStatusBadge,
CompanyTypeBadge,
InvoiceStatusBadge,