refactor: refactoring of deals and statuses dnd
This commit is contained in:
@ -10,14 +10,14 @@ import { DealSchema } from "@/types/DealSchema";
|
||||
import { StatusSchema } from "@/types/StatusSchema";
|
||||
import { sortByLexorank } from "@/utils/lexorank";
|
||||
|
||||
type BoardSectionProps = {
|
||||
type Props = {
|
||||
id: string;
|
||||
status: StatusSchema;
|
||||
deals: DealSchema[];
|
||||
isDragging?: boolean;
|
||||
};
|
||||
|
||||
const StatusColumn = ({ id, status, deals, isDragging }: BoardSectionProps) => {
|
||||
const StatusColumn = ({ id, status, deals, isDragging }: Props) => {
|
||||
const { setNodeRef } = useDroppable({ id });
|
||||
const sortedDeals = useMemo(
|
||||
() => sortByLexorank(deals.filter(deal => deal.statusId === status.id)),
|
||||
|
||||
Reference in New Issue
Block a user