mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 15:18:11 +00:00
@@ -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
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
export {
|
||||
BookingStatusBadge,
|
||||
CompanyNationalityBadge,
|
||||
CompanyStatusBadge,
|
||||
CompanyTypeBadge,
|
||||
InvoiceStatusBadge,
|
||||
|
||||
Reference in New Issue
Block a user