Hard
Complete the state update logic for this sortable list component:
1const DraggableList = ({ items }) => {2 const [list, setList] = useState(items);3 const [draggedItem, setDraggedItem] = useState(null);45 const handleDragStart = (item) => setDraggedItem(item);67 const handleDragOver = (e, targetItem) => {8 e.preventDefault();9 if (draggedItem?.id === targetItem.id) return;1011 _______________________12 _______________________13 _______________________14 };1516 return (17 <ul className="space-y-2">18 {list.map(item => (19 <li20 key={item.id}21 draggable22 onDragStart={() => handleDragStart(item)}23 onDragOver={(e) => handleDragOver(e, item)}24 className="p-2 bg-gray-100 rounded cursor-move"25 >26 {item.text}27 </li>28 ))}29 </ul>30 );31};