feat: board and status selects in deal editor

This commit is contained in:
2025-09-02 14:41:28 +04:00
parent a6d8948e9d
commit 72ed69db24
13 changed files with 192 additions and 121 deletions

View File

@ -1,6 +1,6 @@
"use client";
import { FC, useEffect } from "react";
import { FC, useEffect, useState } from "react";
import ObjectSelect, {
ObjectSelectProps,
} from "@/components/selects/ObjectSelect/ObjectSelect";
@ -15,12 +15,17 @@ type Props = Omit<
};
const StatusSelect: FC<Props> = ({ boardId, ...props }) => {
const [isInitial, setIsInitial] = useState<boolean>(true);
const onClear = () => props.onChange(null);
const { statuses } = useStatusesList({ boardId });
useEffect(() => {
if (!boardId) props.onChange(null);
if (isInitial) {
setIsInitial(false);
} else {
onClear();
}
}, [boardId]);
return (