import { useState } from "react"; import Link from "next/link"; import Image from "next/image"; import { useRouter } from "next/router"; import useSWR, { mutate } from "swr"; // hooks import useUserAuth from "hooks/use-user-auth"; // services import IntegrationService from "services/integration"; // components import { DeleteImportModal, GithubImporterRoot, JiraImporterRoot, SingleImport, } from "components/integration"; // ui import { Loader, PrimaryButton } from "components/ui"; // icons import { ArrowPathIcon } from "@heroicons/react/24/outline"; import { ArrowRightIcon } from "components/icons"; // types import { IImporterService } from "types"; // fetch-keys import { IMPORTER_SERVICES_LIST } from "constants/fetch-keys"; // constants import { IMPORTERS_EXPORTERS_LIST } from "constants/workspace"; const IntegrationGuide = () => { const [refreshing, setRefreshing] = useState(false); const [deleteImportModal, setDeleteImportModal] = useState(false); const [importToDelete, setImportToDelete] = useState(null); const router = useRouter(); const { workspaceSlug, provider } = router.query; const { user } = useUserAuth(); const { data: importerServices } = useSWR( workspaceSlug ? IMPORTER_SERVICES_LIST(workspaceSlug as string) : null, workspaceSlug ? () => IntegrationService.getImporterServicesList(workspaceSlug as string) : null ); const handleDeleteImport = (importService: IImporterService) => { setImportToDelete(importService); setDeleteImportModal(true); }; return ( <> setDeleteImportModal(false)} data={importToDelete} user={user} />
{!provider && ( <>
Relocation Guide
You can now transfer all the issues that you{"'"}ve created in other tracking services. This tool will guide you to relocate the issue to Plane.
Read More
{IMPORTERS_EXPORTERS_LIST.map((service) => (
{`${service.title}

{service.title}

{service.description}

))}

Previous Imports

{importerServices ? ( importerServices.length > 0 ? (
{importerServices.map((service) => ( handleDeleteImport(service)} /> ))}
) : (

No previous imports available.

) ) : ( )}
)} {provider && provider === "github" && } {provider && provider === "jira" && }
); }; export default IntegrationGuide;