overleaf/services/web/frontend/js/features/review-panel-new/components/review-panel-tabs.tsx
David 7002d1e4bf Merge pull request #20511 from overleaf/dp-review-panel-footer
Update UI for new review panel footer

GitOrigin-RevId: 8beb554f78fa5876d5349981d96b44a16ab5567c
2024-09-25 08:05:07 +00:00

37 lines
1 KiB
TypeScript

import { Dispatch, FC, memo, SetStateAction } from 'react'
import classnames from 'classnames'
import { SubView } from '../components/review-panel'
import MaterialIcon from '@/shared/components/material-icon'
import { useTranslation } from 'react-i18next'
const ReviewPanelTabs: FC<{
subView: SubView
setSubView: Dispatch<SetStateAction<SubView>>
}> = ({ subView, setSubView }) => {
const { t } = useTranslation()
return (
<>
<button
className={classnames('review-panel-tab', {
'review-panel-tab-active': subView === 'cur_file',
})}
onClick={() => setSubView('cur_file')}
>
<MaterialIcon type="description" />
{t('current_file')}
</button>
<button
className={classnames('review-panel-tab', {
'review-panel-tab-active': subView === 'overview',
})}
onClick={() => setSubView('overview')}
>
<MaterialIcon type="list" />
{t('overview')}
</button>
</>
)
}
export default memo(ReviewPanelTabs)