|
|
|
|
@ -19,6 +19,9 @@ const FileDropdown = ({
|
|
|
|
|
}) => {
|
|
|
|
|
const [expanded, setExpanded] = useState(false)
|
|
|
|
|
const [items, setItems] = useState<Item[]>([])
|
|
|
|
|
const changeHandler = (next: boolean) => {
|
|
|
|
|
setExpanded(next)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const onOpen = useCallback(() => {
|
|
|
|
|
setExpanded(true)
|
|
|
|
|
@ -62,11 +65,15 @@ const FileDropdown = ({
|
|
|
|
|
|
|
|
|
|
// a list of files with an icon and a title
|
|
|
|
|
return (
|
|
|
|
|
<Button auto onClick={onOpen} className={styles.button} iconRight={<ChevronDown />}>
|
|
|
|
|
<Popover content={content} visible={expanded} hideArrow={true}>
|
|
|
|
|
<>
|
|
|
|
|
<Button auto onClick={onOpen} className={styles.button} iconRight={<ChevronDown />}>
|
|
|
|
|
Jump to {files.length} {files.length === 1 ? 'file' : 'files'}
|
|
|
|
|
</Popover>
|
|
|
|
|
</Button >
|
|
|
|
|
</Button>
|
|
|
|
|
<Popover
|
|
|
|
|
onVisibleChange={changeHandler}
|
|
|
|
|
content={content} visible={expanded} hideArrow={true} onClick={onClose} />
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
|
|
)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|