import { FC, useState } from "react"; // react-hook-form import { Control, Controller, UseFormWatch } from "react-hook-form"; // hooks import useProjects from "hooks/use-projects"; // components import { SelectRepository, TFormValues, TIntegrationSteps } from "components/integration"; // ui import { CustomSearchSelect, PrimaryButton, SecondaryButton } from "components/ui"; // helpers import { truncateText } from "helpers/string.helper"; // types import { IWorkspaceIntegrations } from "types"; type Props = { handleStepChange: (value: TIntegrationSteps) => void; integration: IWorkspaceIntegrations | false | undefined; control: Control; watch: UseFormWatch; }; export const GithubImportData: FC = ({ handleStepChange, integration, control, watch }) => { const { projects } = useProjects(); const options = projects.map((project) => ({ value: project.id, query: project.name, content:

{truncateText(project.name, 25)}

, })) ?? []; return (

Select Repository

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

{integration && ( ( )} /> )}

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.

( )} />
handleStepChange("import-configure")}>Back handleStepChange("repo-details")} disabled={!watch("github") || !watch("project")} > Next
); };