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,5 +1,6 @@
import { Box, Card, Group, Pill, Stack, Text } from "@mantine/core";
import { useDealsContext } from "@/app/deals/contexts/DealsContext";
import { useProjectsContext } from "@/app/deals/contexts/ProjectsContext";
import { useDrawersContext } from "@/drawers/DrawersContext";
import { DealSchema } from "@/lib/client";
import styles from "./DealCard.module.css";
@ -9,11 +10,16 @@ type Props = {
};
const DealCard = ({ deal }: Props) => {
const { selectedProject } = useProjectsContext();
const { dealsCrud } = useDealsContext();
const { openDrawer } = useDrawersContext();
const onClick = () => {
openDrawer({ key: "dealEditorDrawer", props: { deal, dealsCrud } });
if (!selectedProject) return;
openDrawer({
key: "dealEditorDrawer",
props: { project: selectedProject, deal, dealsCrud },
});
};
return (
@ -22,7 +28,9 @@ const DealCard = ({ deal }: Props) => {
className={styles.container}>
<Group
justify={"space-between"}
ml={"xs"}
wrap={"nowrap"}
pl={"xs"}
gap={"xs"}
align={"start"}>
<Text
c={"dodgerblue"}
@ -30,7 +38,7 @@ const DealCard = ({ deal }: Props) => {
{deal.name}
</Text>
<Box className={styles["deal-id"]}>
<Text>ID: {deal.id}</Text>
<Text style={{ textWrap: "nowrap" }}>ID: {deal.id}</Text>
</Box>
</Group>
<Stack className={styles["deal-data"]}>