refactor file browser list
This commit is contained in:
@@ -7,7 +7,7 @@ import FileElement from "./FileElement"
|
||||
interface Props {
|
||||
file?: File | null
|
||||
dir?: Directory | null
|
||||
onClick?: (data: File | Directory) => void
|
||||
onClick?: (event: React.MouseEvent ,data: File | Directory) => void
|
||||
onContextMenu?: (e:React.MouseEvent) => void
|
||||
}
|
||||
|
||||
@@ -15,11 +15,11 @@ const FileBrowserElement: React.FC<Props> = (props) => {
|
||||
return (
|
||||
<tr
|
||||
className="hover:bg-gray-100 dark:hover:bg-gray-900 text-lg"
|
||||
onClick={()=>{
|
||||
onClick={(e)=>{
|
||||
if(props.file){
|
||||
props.onClick?.(props.file)
|
||||
props.onClick?.(e,props.file)
|
||||
}else if(props.dir){
|
||||
props.onClick?.(props.dir)
|
||||
props.onClick?.(e,props.dir)
|
||||
}
|
||||
}}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user