refactor: refactoring of deals and statuses dnd

This commit is contained in:
2025-08-02 10:58:24 +04:00
parent 8ae198897d
commit 459487a896
8 changed files with 396 additions and 306 deletions

View File

@ -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)),