Files
web/src/components/cost.tsx
2024-11-26 15:29:18 +00:00

21 lines
401 B
TypeScript

import { VmCostPlan } from "../api";
export default function CostLabel({ cost }: { cost: VmCostPlan }) {
function intervalName(n: string) {
switch (n) {
case "day":
return "Day";
case "month":
return "Month";
case "year":
return "Year";
}
}
return (
<>
{cost.amount} {cost.currency}/{intervalName(cost.interval_type)}
</>
);
}