Update useDropzonesInternal.ts

This commit is contained in:
Nate Kelley 2025-02-18 16:17:50 -07:00
parent 12a619480a
commit 00f668852b
No known key found for this signature in database
GPG Key ID: FD90372AB8D98B4F
1 changed files with 8 additions and 2 deletions

View File

@ -44,6 +44,12 @@ export const useDropzonesInternal = ({
const { errorZone, setErrorZone, onDragOverCheckErrorZone } = useErrorZones();
const availableDropZone: DropZoneInternal = {
id: SelectAxisContainerId.Available,
title: 'Available',
items: [] //empty array because we don't need to show items in the available zone
};
const setDropZones = useMemo(() => {
return (
newDropZones: (prev: DropZoneInternal[]) => DropZoneInternal[],
@ -242,8 +248,8 @@ export const useDropzonesInternal = ({
return null;
});
const findZoneById = useMemoizedFn((zoneId: string): DropZoneInternal | null => {
return dropZones.find((zone) => zone.id === zoneId) || null;
const findZoneById = useMemoizedFn((zoneId: string): DropZoneInternal => {
return dropZones.find((zone) => zone.id === zoneId) || availableDropZone;
});
const findZoneByOver = useMemoizedFn((over: Over): SelectAxisContainerId | null => {