import { observer } from "mobx-react-lite"; // hooks import { CustomSearchSelect } from "@plane/ui"; import { useProject } from "@/hooks/store"; // ui type Props = { value: string[] | undefined; onChange: (val: string[] | null) => void; projectIds: string[] | undefined; }; export const SelectProject: React.FC = observer((props) => { const { value, onChange, projectIds } = props; const { getProjectById } = useProject(); const options = projectIds?.map((projectId) => { const projectDetails = getProjectById(projectId); return { value: projectDetails?.id, query: `${projectDetails?.name} ${projectDetails?.identifier}`, content: (
{projectDetails?.identifier} {projectDetails?.name}
), }; }); return ( onChange(val)} options={options} label={ value && value.length > 0 ? projectIds ?.filter((p) => value.includes(p)) .map((p) => getProjectById(p)?.name) .join(", ") : "All projects" } multiple /> ); });