saleor-dashboard/src/components/WeightRange/WeightRange.tsx
Michał Droń d5c9a3dae8
Add trailing commas (#2062)
* Require trailing commas

* Add trailing commas

* Add trailing commas in testUtils dir

* Add trailing commas
2022-06-21 11:36:55 +02:00

42 lines
959 B
TypeScript

import React from "react";
import { FormattedMessage } from "react-intl";
import { Weight } from "../Weight";
export interface WeightRangeProps {
from?: Weight;
to?: Weight;
}
const WeightRange: React.FC<WeightRangeProps> = ({ from, to }) =>
from && to ? (
<FormattedMessage
id="5x6yT9"
defaultMessage="{fromValue} {fromUnit} - {toValue} {toUnit}"
description="weight"
values={{
fromUnit: from.unit,
fromValue: from.value,
toUnit: to.unit,
toValue: to.value,
}}
/>
) : from && !to ? (
<FormattedMessage
id="LICZeR"
defaultMessage="from {value} {unit}"
description="weight"
values={from}
/>
) : !from && to ? (
<FormattedMessage
id="qMB6d2"
defaultMessage="to {value} {unit}"
description="weight"
values={to}
/>
) : (
<span>-</span>
);
WeightRange.displayName = "WeightRange";
export default WeightRange;