import { FC } from "react"; import { useRouter } from "next/router"; import { observer } from "mobx-react-lite"; import { Control, Controller, UseFormWatch } from "react-hook-form"; // mobx store import { useMobxStore } from "lib/mobx/store-provider"; // components import { SelectRepository, TFormValues, TIntegrationSteps } from "components/integration"; // ui import { Button, ToggleSwitch } from "@plane/ui"; import { CustomSearchSelect } from "components/ui"; // helpers import { truncateText } from "helpers/string.helper"; // types import { IWorkspaceIntegration } from "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; const router = useRouter(); const { workspaceSlug } = router.query; const { project: projectStore } = useMobxStore(); const projects = workspaceSlug ? projectStore.projects[workspaceSlug.toString()] : undefined; const options = projects ? projects.map((project) => ({ value: project.id, query: project.name, content:

{truncateText(project.name, 25)}

, })) : undefined; 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.

{projects && ( ( p.id === value)?.name ) : ( Select Project ) } onChange={onChange} options={options} optionsClassName="w-full" /> )} /> )}

Sync Issues

Set whether you want to sync the issues or not.

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