import { useState, useEffect } from 'react' import { Table, Button, Modal } from 'antd' import { HourglassOutlined } from '@ant-design/icons' import LoaderPortal from '../../components/LoaderPortal' import { invokeWebApiWrapperAsync } from '../../components/factory' import { MeasureService } from '../../services/api' import { Editor } from './Editor' export const MeasureTable = ({idWell, idCategory, title, columns}) => { const [showLoader, setShowLoader] = useState(false) const [showEditor, setShowEditor] = useState(false) const [lastData, setLastData] = useState({}) const update = ()=>invokeWebApiWrapperAsync(async()=>{ const data = await MeasureService.getLast(idWell, idCategory) setLastData(data) } , setShowLoader , "не удалось загрузить") useEffect(update, [idWell, idCategory]) const timestamp = lastData ? new Date(lastData?.timestamp).toLocaleString() : '-' return

{title}

Дата: {timestamp}   setShowEditor(false)} onCancel={() => setShowEditor(false)} width="95%" footer={null} > }