first implementation renaming

This commit is contained in:
2021-08-29 19:59:25 +02:00
parent 5f4da5d13f
commit 6f25be49ca
5 changed files with 73 additions and 4 deletions

View File

@@ -8,6 +8,9 @@ interface Props {
dir?: Directory
onClick?: (event: React.MouseEvent ,data: File | Directory) => void
onContextMenu?: (e:React.MouseEvent) => void
edit: boolean
onRename?: (newName: string)=>void
onCancleRename?: ()=>void
}
const FileBrowserElement: React.FC<Props> = (props) => {
@@ -25,7 +28,14 @@ const FileBrowserElement: React.FC<Props> = (props) => {
onContextMenu={(e)=>props.onContextMenu?.(e)}
>
{(props.file) ? <FileElement file={props.file}/>:(props.dir)?<DirectoryComponent dir={props.dir} />:<></>}
{(props.file) ? <FileElement
edit={props.edit}
file={props.file}
onCancleRename={props.onCancleRename}
onRename={props.onRename}
/>:(props.dir)?<DirectoryComponent
dir={props.dir}
/>:<></>}
</tr>
)
}