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/integrations"; // components import { DeleteImportModal, GithubImporterRoot, JiraImporterRoot, SingleImport } from "components/integration"; // ui import { Button, Loader } from "@plane/ui"; // icons import { RefreshCw } from "lucide-react"; // types import { IImporterService } from "types"; // fetch-keys import { IMPORTER_SERVICES_LIST } from "constants/fetch-keys"; // constants import { IMPORTERS_LIST } from "constants/workspace"; // services const integrationService = new IntegrationService(); 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 || provider === "csv") && ( <> {/*
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_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;