2024-10-10 09:13:01 -04:00
|
|
|
import { FC, memo } from 'react'
|
2024-08-12 05:50:54 -04:00
|
|
|
import classnames from 'classnames'
|
2024-09-24 04:54:32 -04:00
|
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2024-10-10 09:13:01 -04:00
|
|
|
import {
|
|
|
|
useReviewPanelViewActionsContext,
|
|
|
|
useReviewPanelViewContext,
|
|
|
|
} from '../context/review-panel-view-context'
|
|
|
|
|
|
|
|
const ReviewPanelTabs: FC = () => {
|
|
|
|
const subView = useReviewPanelViewContext()
|
|
|
|
const { setView: setSubView } = useReviewPanelViewActionsContext()
|
2024-08-12 05:50:54 -04:00
|
|
|
|
2024-09-24 04:54:32 -04:00
|
|
|
const { t } = useTranslation()
|
|
|
|
|
2024-08-12 05:50:54 -04:00
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<button
|
2024-09-24 04:54:32 -04:00
|
|
|
className={classnames('review-panel-tab', {
|
|
|
|
'review-panel-tab-active': subView === 'cur_file',
|
2024-08-12 05:50:54 -04:00
|
|
|
})}
|
|
|
|
onClick={() => setSubView('cur_file')}
|
|
|
|
>
|
2024-09-24 04:54:32 -04:00
|
|
|
<MaterialIcon type="description" />
|
|
|
|
{t('current_file')}
|
2024-08-12 05:50:54 -04:00
|
|
|
</button>
|
|
|
|
<button
|
2024-09-24 04:54:32 -04:00
|
|
|
className={classnames('review-panel-tab', {
|
|
|
|
'review-panel-tab-active': subView === 'overview',
|
2024-08-12 05:50:54 -04:00
|
|
|
})}
|
|
|
|
onClick={() => setSubView('overview')}
|
|
|
|
>
|
2024-09-24 04:54:32 -04:00
|
|
|
<MaterialIcon type="list" />
|
|
|
|
{t('overview')}
|
2024-08-12 05:50:54 -04:00
|
|
|
</button>
|
|
|
|
</>
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default memo(ReviewPanelTabs)
|