2025-01-07 02:29:29 +08:00
|
|
|
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';
|
2025-01-07 02:29:29 +08:00
|
|
|
|
|
|
|
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',
|
2025-01-07 02:29:29 +08:00
|
|
|
'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'
|
2025-01-07 02:29:29 +08:00
|
|
|
)}>
|
|
|
|
Drag here to create a new row
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|