mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-26 18:42:49 +00:00
Merge branch 'dev' into freight/nati-2
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user