Create request/folder with proper folderId

This commit is contained in:
Gregory Schier
2024-09-03 08:06:30 -07:00
parent d99fe98347
commit 7ef264223f
3 changed files with 9 additions and 5 deletions

View File

@@ -1,3 +1,4 @@
import { useActiveRequest } from '../hooks/useActiveRequest';
import { useCreateDropdownItems } from '../hooks/useCreateDropdownItems';
import type { DropdownProps } from './core/Dropdown';
import { Dropdown } from './core/Dropdown';
@@ -7,7 +8,13 @@ interface Props extends Omit<DropdownProps, 'items'> {
}
export function CreateDropdown({ hideFolder, children, ...props }: Props) {
const items = useCreateDropdownItems({ hideFolder, hideIcons: true });
const activeRequest = useActiveRequest();
const folderId = activeRequest?.folderId ?? null;
const items = useCreateDropdownItems({
hideFolder,
hideIcons: true,
folderId,
});
return (
<Dropdown items={items} {...props}>
{children}