|
|
|
|
@ -5,14 +5,18 @@ import { getRegionNameById } from "../../Map/Popup/mode-popup/config.js";
|
|
|
|
|
import { Button, Popover } from "antd";
|
|
|
|
|
import { AddressSearch } from "../../Map/AddressSearch.jsx";
|
|
|
|
|
import { SearchOutlined } from "@ant-design/icons";
|
|
|
|
|
import { useTable } from "../../stores/useTable.js";
|
|
|
|
|
|
|
|
|
|
export const useColumns = (fields = []) => {
|
|
|
|
|
const { data: regions } = useGetRegions();
|
|
|
|
|
const {
|
|
|
|
|
tableState: { fullScreen },
|
|
|
|
|
} = useTable();
|
|
|
|
|
|
|
|
|
|
return useMemo(() => {
|
|
|
|
|
return [
|
|
|
|
|
{
|
|
|
|
|
title: (
|
|
|
|
|
title: fullScreen ? (
|
|
|
|
|
<div className="flex items-center justify-between">
|
|
|
|
|
<span>Адрес</span>
|
|
|
|
|
<Popover
|
|
|
|
|
@ -25,6 +29,8 @@ export const useColumns = (fields = []) => {
|
|
|
|
|
</Button>
|
|
|
|
|
</Popover>
|
|
|
|
|
</div>
|
|
|
|
|
) : (
|
|
|
|
|
"Адрес"
|
|
|
|
|
),
|
|
|
|
|
dataIndex: "address",
|
|
|
|
|
key: "address",
|
|
|
|
|
@ -83,5 +89,5 @@ export const useColumns = (fields = []) => {
|
|
|
|
|
},
|
|
|
|
|
...fields,
|
|
|
|
|
];
|
|
|
|
|
}, [regions?.normalized, fields]);
|
|
|
|
|
}, [regions?.normalized, fields, fullScreen]);
|
|
|
|
|
};
|
|
|
|
|
|