overleaf-cep/services/web/frontend/js/features/ide-redesign/components/file-tree/file-tree-toolbar.tsx
David 061f10a059 Merge pull request #25752 from overleaf/dp-delete-multiple-files
Add bulk delete button to file tree toolbar

GitOrigin-RevId: c857d8f5027eddb29b1ca324efe1a0e94ef4c28b
2025-05-22 08:06:42 +00:00

32 lines
956 B
TypeScript

import { useTranslation } from 'react-i18next'
import MaterialIcon from '@/shared/components/material-icon'
import React from 'react'
import useCollapsibleFileTree from '../../hooks/use-collapsible-file-tree'
import FileTreeActionButtons from './file-tree-action-buttons'
function FileTreeToolbar() {
const { t } = useTranslation()
const { fileTreeExpanded, toggleFileTreeExpanded } = useCollapsibleFileTree()
return (
<div className="file-tree-toolbar">
<button
className="file-tree-expand-collapse-button"
onClick={toggleFileTreeExpanded}
aria-label={
fileTreeExpanded ? t('hide_file_tree') : t('show_file_tree')
}
>
<MaterialIcon
type={
fileTreeExpanded ? 'keyboard_arrow_down' : 'keyboard_arrow_right'
}
/>
<h4>{t('file_tree')}</h4>
</button>
<FileTreeActionButtons />
</div>
)
}
export default FileTreeToolbar