Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 | 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x | import { Button, TableFilterItem } from '@tmk/ui-kit'
import { FC, useState } from 'react'
import { Pipe } from '@/entities/pipe'
import { useTranslate } from '@/shared/lib'
import { TableFilters } from '@/shared/ui'
import { useRouter } from 'next/router'
import { downloadChangeLogXLSX } from '@/entities/change-log'
export interface ChangeLogHeaderProps {
pipe?: Pipe
filters: TableFilterItem[]
}
export const ChangeLogHeader: FC<ChangeLogHeaderProps> = ({ pipe, filters }) => {
const { t } = useTranslate(['common'])
const router = useRouter()
const [isDownloadingExcel, setIsDownloadingExcel] = useState(false)
const handleDownloadChangeLogXLSX = async () => {
setIsDownloadingExcel(true)
const filtersExcel = {
objectId: pipe?.id,
...router?.query,
}
await downloadChangeLogXLSX(filtersExcel)
setIsDownloadingExcel(false)
}
return (
<div className='flex justify-between items-center'>
<div className='flex flex-col'>
<div className='flex gap-2'>
<h2 className='text-black'>
⌀{pipe?.diameter?.value} - {pipe?.side?.value} -{pipe?.strengthGroup?.name} - {pipe?.connection?.name}
</h2>
</div>
<h3 className='text-text-secondary text-main-regular'>{pipe?.identifyNumber}</h3>
</div>
<div className='flex gap-2 items-center h-20'>
<TableFilters filters={filters} t={t} />
<Button
variant='outlined'
color='secondary'
className='flex flex-shrink-0'
childrenClassName='text-main-semibold'
loading={isDownloadingExcel}
onClick={handleDownloadChangeLogXLSX}
>
{t('Download_to_Excel')}
</Button>
{/* // TODO #52621 Временно скрыто */}
{/* <InDevelopmentWrapper t={t}>
<Button variant='icon'>
<GearIcon className='w-5 h-5 fill-blue-dark' />
</Button>
</InDevelopmentWrapper> */}
</div>
</div>
)
}
|