import { FC } from "react"; import { observer } from "mobx-react-lite"; import { Control, Controller, UseFormWatch } from "react-hook-form"; import { IWorkspaceIntegration } from "@plane/types"; // hooks // components import { Button, CustomSearchSelect, ToggleSwitch } from "@plane/ui"; import { SelectRepository, TFormValues, TIntegrationSteps } from "@/components/integration"; // ui // helpers import { truncateText } from "@/helpers/string.helper"; import { useProject } from "@/hooks/store"; // types type Props = { handleStepChange: (value: TIntegrationSteps) => void; integration: IWorkspaceIntegration | false | undefined; control: Control; watch: UseFormWatch; }; export const GithubImportData: FC = observer((props) => { const { handleStepChange, integration, control, watch } = props; // store hooks const { workspaceProjectIds, getProjectById } = useProject(); const options = workspaceProjectIds?.map((projectId) => { const projectDetails = getProjectById(projectId); return { value: `${projectDetails?.id}`, query: `${projectDetails?.name}`, content:

{truncateText(projectDetails?.name ?? "", 25)}

, }; }); return (

Select Repository

Select the repository that you want the issues to be imported from.

{integration && ( ( Select Repository } onChange={onChange} characterLimit={50} /> )} /> )}

Select Project

Select the project to import the issues to.

{workspaceProjectIds && ( ( Select Project } onChange={onChange} options={options} optionsClassName="w-full" /> )} /> )}

Sync Issues

Set whether you want to sync the issues or not.

( onChange(!value)} /> )} />
); });