import { useState } from "react"; import { observer } from "mobx-react"; import Image from "next/image"; import Link from "next/link"; import { useParams, useSearchParams } from "next/navigation"; import useSWR, { mutate } from "swr"; // icons import { RefreshCw } from "lucide-react"; // types import { IImporterService } from "@plane/types"; // ui import { Button } from "@plane/ui"; // components import { EmptyState } from "@/components/empty-state"; import { DeleteImportModal, GithubImporterRoot, JiraImporterRoot, SingleImport } from "@/components/integration"; import { ImportExportSettingsLoader } from "@/components/ui"; // constants import { EmptyStateType } from "@/constants/empty-state"; import { IMPORTER_SERVICES_LIST } from "@/constants/fetch-keys"; import { IMPORTERS_LIST } from "@/constants/workspace"; // hooks import { useUser } from "@/hooks/store"; // services import { IntegrationService } from "@/services/integrations"; // services const integrationService = new IntegrationService(); const IntegrationGuide = observer(() => { // states const [refreshing, setRefreshing] = useState(false); const [deleteImportModal, setDeleteImportModal] = useState(false); const [importToDelete, setImportToDelete] = useState(null); // router const { workspaceSlug } = useParams(); const searchParams = useSearchParams(); const provider = searchParams.get("provider"); // store hooks const { data: currentUser } = useUser(); 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={currentUser || null} />
{(!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)} /> ))}
) : (
) ) : ( )}
)} {provider && provider === "github" && } {provider && provider === "jira" && }
); }); export default IntegrationGuide;