Merge branch 'dev' into freight/nati-2

This commit is contained in:
Nathnael
2026-08-09 13:44:18 +00:00
79 changed files with 1463 additions and 239 deletions

View File

@@ -8,17 +8,27 @@ export interface CurrencySelectorProps {
disabled?: boolean;
/** Validation error shown under the cards. */
error?: string;
/**
* Offer USD alongside ETB. Import shipments only — export and domestic
* traffic is invoiced in ETB, so the option stays hidden everywhere else.
* USD is settled by bank transfer, never through the online gateway.
*/
allowUsd?: boolean;
}
// ponytail: ETB-only for now — restore the USD entry when multi-currency billing returns.
const OPTIONS = [
{
code: "ETB",
symbol: "Br",
name: "Ethiopian Birr",
hint: "All shipments are invoiced in ETB",
},
] as const;
const ETB_OPTION = {
code: "ETB",
symbol: "Br",
name: "Ethiopian Birr",
hint: "Pay online through the payment gateway",
} as const;
const USD_OPTION = {
code: "USD",
symbol: "$",
name: "US Dollar",
hint: "Paid by bank transfer — send the slip to Finance",
} as const;
/**
* Card-style USD/ETB billing-currency picker. Renders unselected when `value`
@@ -29,7 +39,9 @@ export function CurrencySelector({
onChange,
disabled = false,
error,
allowUsd = false,
}: CurrencySelectorProps) {
const options = allowUsd ? [ETB_OPTION, USD_OPTION] : [ETB_OPTION];
return (
<Box>
<Box
@@ -39,7 +51,7 @@ export function CurrencySelector({
gap: 10,
}}
>
{OPTIONS.map((o) => {
{options.map((o) => {
const selected = value === o.code;
return (
<button