/** @jsxRuntime classic */ /** @jsx jsx */ import { FC } from 'react'; import { useDraggable } from '@dnd-kit/core'; import { jsx } from '@emotion/react'; import { IWeeklyDraggableProps } from '../../types'; import { useMiddlewareContext } from '../../hooks/useMiddlewareContext'; export const WeeklyDraggable: FC = ({ id, state, parentId, children, }) => { const elementId = `draggable-${id}`; const { options } = useMiddlewareContext(); const { setNodeRef, listeners, attributes } = useDraggable({ id: String(id), data: { parentId: parentId, event: state, weeklyView: true, }, }); if (options.dragAndDrop) { return (
{children}
); } else { return
{children}
; } };