mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-29 11:33:29 -05:00
39b6b8baed
[web] Migrate the file outline styling from LESS to SCSS GitOrigin-RevId: 5e485b13a7358e5dcab2c75ee7d36a07e1401e26
24 lines
774 B
TypeScript
24 lines
774 B
TypeScript
import { memo, type Dispatch, type SetStateAction } from 'react'
|
|
import { useTranslation } from 'react-i18next'
|
|
import MaterialIcon from '@/shared/components/material-icon'
|
|
|
|
export const OutlineItemToggleButton = memo<{
|
|
expanded: boolean
|
|
setExpanded: Dispatch<SetStateAction<boolean>>
|
|
}>(({ expanded, setExpanded }) => {
|
|
const { t } = useTranslation()
|
|
|
|
return (
|
|
<button
|
|
className="outline-item-expand-collapse-btn"
|
|
onClick={() => setExpanded(value => !value)}
|
|
aria-label={expanded ? t('collapse') : t('expand')}
|
|
>
|
|
<MaterialIcon
|
|
type={expanded ? 'keyboard_arrow_down' : 'keyboard_arrow_right'}
|
|
className="outline-caret-icon"
|
|
/>
|
|
</button>
|
|
)
|
|
})
|
|
OutlineItemToggleButton.displayName = 'OutlineItemToggleButton'
|