Add name for point popup

dev
Platon Yasev 3 years ago
parent cad79fe0c0
commit 60afc8d076

@ -37,6 +37,9 @@ const useRateValue = (feature) => {
}; };
const pointConfig = [ const pointConfig = [
{
field: "name",
},
{ {
field: "category", field: "category",
name: "Тип", name: "Тип",
@ -77,12 +80,20 @@ export const MapPopup = ({ feature, lat, lng, onClose }) => {
return ( return (
<Row className={twMerge("p-1")} key={item.field ?? "rate"}> <Row className={twMerge("p-1")} key={item.field ?? "rate"}>
{item.field === "name" ? (
<Col span={24} className={"font-semibold text-center"}>
{value}
</Col>
) : (
<>
<Col span={layout.keyCol} className={"font-semibold"}> <Col span={layout.keyCol} className={"font-semibold"}>
{item.name} {item.name}
</Col> </Col>
<Col span={layout.valueCol}> <Col span={layout.valueCol}>
{item.formatter ? item.formatter(value) : value} {item.formatter ? item.formatter(value) : value}
</Col> </Col>
</>
)}
</Row> </Row>
); );
})} })}

Loading…
Cancel
Save