first implementation renaming
This commit is contained in:
@@ -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>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user