2024-08-12 05:50:54 -04:00
|
|
|
import { Dispatch, FC, memo, SetStateAction } from 'react'
|
|
|
|
import classnames from 'classnames'
|
|
|
|
import { SubView } from '../components/review-panel'
|
2024-09-24 04:54:32 -04:00
|
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
import { useTranslation } from 'react-i18next'
|
2024-08-12 05:50:54 -04:00
|
|
|
|
|
|
|
const ReviewPanelTabs: FC<{
|
|
|
|
subView: SubView
|
|
|
|
setSubView: Dispatch<SetStateAction<SubView>>
|
|
|
|
}> = ({ subView, setSubView }) => {
|
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)
|