can add new courses, kinda janky

This commit is contained in:
2025-07-22 15:09:10 -06:00
parent 704a5ae404
commit 46e0c36916
7 changed files with 197 additions and 109 deletions

View File

@@ -7,11 +7,13 @@ export function StoragePathSelector({
setValue,
label,
className,
setLastTypedValue,
}: {
value: string;
setValue: (newValue: string) => void;
label: string;
className?: string;
setLastTypedValue?: (value: string) => void;
}) {
const [path, setPath] = useState(value);
const { data: directoryContents } = useDirectoryContentsQuery(value);
@@ -25,6 +27,10 @@ export function StoragePathSelector({
setPath(value);
}, [value]);
useEffect(() => {
if (setLastTypedValue) setLastTypedValue(path);
}, [path, setLastTypedValue]);
const handleKeyDown = (e: React.KeyboardEvent<HTMLInputElement>) => {
if (!isFocused || filteredFolders.length === 0) return;
if (e.key === "ArrowDown") {