5bfe2a0331
* feat: add file manager module - Complete file manager implementation with UI/UX - Add drive management functionality - Add file upload/download with progress tracking - Add stamp integration and handling - Add bulk operations and context menus Co-authored-by: Roland Seres <roland.seres90@gmail.com> Co-authored-by: nidishk <nidishkrishnan45@gmail.com>
36 lines
936 B
TypeScript
36 lines
936 B
TypeScript
import { ReactElement } from 'react'
|
|
import './FileBrowserTopBar.scss'
|
|
import { useView } from '../../../../../pages/filemanager/ViewContext'
|
|
import { ViewType } from '../../../constants/transfers'
|
|
|
|
type Props = {
|
|
onOpenMenu?: (anchorEl: HTMLElement) => void
|
|
canOpen?: boolean
|
|
}
|
|
|
|
export function FileBrowserTopBar({ onOpenMenu, canOpen = true }: Props): ReactElement {
|
|
const { view, actualItemView } = useView()
|
|
|
|
const viewText = view === ViewType.Trash ? ' Trash' : ''
|
|
|
|
return (
|
|
<div className="fm-file-browser-top-bar">
|
|
<div className="fm-file-browser-top-bar__title">
|
|
{actualItemView}
|
|
{viewText}
|
|
</div>
|
|
{canOpen && (
|
|
<button
|
|
type="button"
|
|
className="fm-topbar-kebab"
|
|
aria-haspopup="menu"
|
|
aria-label="More actions"
|
|
onClick={e => onOpenMenu?.(e.currentTarget)}
|
|
>
|
|
⋯
|
|
</button>
|
|
)}
|
|
</div>
|
|
)
|
|
}
|