"use client"; import { useState } from "react"; import MultiSelect from "../../../components/controls/MultiSelect"; import Alert from "../../../components/modals/Alert"; import type { ChipOption } from "../../../components/controls/MultiSelect/MultiSelect.types"; import { useTranslation } from "../../../contexts/MessagesContext"; import { useCreateFlow } from "../../context/CreateFlowContext"; import { CreateFlowHeaderLockup } from "../../components/CreateFlowHeaderLockup"; import { CreateFlowStepShell } from "../../components/CreateFlowStepShell"; import { CREATE_FLOW_MD_UP_COLUMN_MAX_CLASS } from "../../components/createFlowLayoutTokens"; export function ConfirmStakeholdersScreen() { const { markCreateFlowInteraction } = useCreateFlow(); const t = useTranslation("create.confirmStakeholders"); const [toastDismissed, setToastDismissed] = useState(false); const [stakeholderOptions, setStakeholderOptions] = useState( [], ); const handleAddStakeholder = () => { markCreateFlowInteraction(); setStakeholderOptions((prev) => [ ...prev, { id: crypto.randomUUID(), label: "", state: "Custom" }, ]); }; const handleCustomChipConfirm = (chipId: string, value: string) => { markCreateFlowInteraction(); setStakeholderOptions((prev) => prev.map((opt) => opt.id === chipId ? { ...opt, label: value, state: "Selected" } : opt, ), ); }; const handleCustomChipClose = (chipId: string) => { markCreateFlowInteraction(); setStakeholderOptions((prev) => prev.filter((opt) => opt.id !== chipId)); }; const handleChipClick = (chipId: string) => { markCreateFlowInteraction(); setStakeholderOptions((prev) => prev.filter((opt) => opt.id !== chipId)); }; return ( <>
{!toastDismissed && (
setToastDismissed(true)} className="w-full !px-[var(--space-600,24px)] !py-[var(--space-400,16px)] md:!py-4" />
)} ); }