-
Notifications
You must be signed in to change notification settings - Fork 89
/
Copy pathnext-item-list.tsx
34 lines (31 loc) · 922 Bytes
/
next-item-list.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from "react";
import { Droppable } from "react-beautiful-dnd";
import { Item } from "../types/item";
import ItemCard from "./item-card";
import styles from "../styles/next-item-list.module.scss";
interface NextItemListProps {
next: Item | null;
}
export default function NextItemList(props: NextItemListProps) {
const { next } = props;
return (
<div className={styles.container}>
<Droppable droppableId="next" direction="horizontal">
{(provided) => (
<div className={styles.wrapper}>
<div
ref={provided.innerRef}
{...provided.droppableProps}
className={styles.list}
>
{next && (
<ItemCard draggable index={0} item={next} key={next.id} />
)}
{provided.placeholder}
</div>
</div>
)}
</Droppable>
</div>
);
}