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 | 1x 1x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x 2x | import { FC } from 'react'
import { Button } from '@tmk/ui-kit'
import { useTranslate } from '@/shared/lib'
import {
DRAFT_OPERATIONS_FILTERS_BY_STATUS,
operationNameAtom,
OPERATIONS_DRAFT_PRIMARY_KEY,
useOperationJournal,
getOperationDraftNameFilters,
} from '@/entities/accounting-object'
import { useAtomValue } from 'jotai'
export const ProfileHeaderContent: FC = () => {
const { t } = useTranslate(['common'])
const operationName = useAtomValue(operationNameAtom)
const { data: draftOperations } = useOperationJournal(OPERATIONS_DRAFT_PRIMARY_KEY, {
filters: {
status: DRAFT_OPERATIONS_FILTERS_BY_STATUS,
...getOperationDraftNameFilters(operationName),
},
})
return (
<div className='flex items-center gap-x-2.5'>
{!!draftOperations?.['hydra:totalItems'] && (
<div className='px-2 py-1 bg-gray-tertiary rounded-base hover:cursor-pointer'>
<h2 className='text-text-secondary'>{draftOperations['hydra:totalItems']}</h2>
</div>
)}
<Button href='/profile/operations/draft' variant='outlined' color='secondary'>
<h3>{t('Incomplete operations')}</h3>
</Button>
<Button href='/profile/operations'>
<h3>{t('Operations changelog')}</h3>
</Button>
</div>
)
}
|