buster/web/src/components/ui/grid/_BusterBusterNewItemDropzon...

26 lines
761 B
TypeScript
Raw Normal View History

import { useDroppable } from '@dnd-kit/core';
import React from 'react';
import { HEIGHT_OF_DROPZONE, NEW_ROW_ID } from './config';
2025-02-27 11:51:11 +08:00
import { cn } from '@/lib/utils';
export const BusterNewItemDropzone: React.FC = () => {
const { setNodeRef, isOver } = useDroppable({
id: NEW_ROW_ID
});
return (
<div
ref={setNodeRef}
style={{ maxHeight: HEIGHT_OF_DROPZONE, minHeight: HEIGHT_OF_DROPZONE }}
2025-02-27 11:51:11 +08:00
className={cn(
2025-02-19 04:23:44 +08:00
'flex h-full w-full items-center justify-center rounded-sm border-dashed',
'transition-colors duration-200 ease-in-out',
2025-02-27 13:27:01 +08:00
'text-base',
2025-02-27 11:51:11 +08:00
'text-gray-dark border',
isOver && 'bg-primary-light text-background border-solid'
)}>
Drag here to create a new row
</div>
);
};