import { useState } from "react"; import { observer } from "mobx-react-lite"; import Image from "next/image"; import Link from "next/link"; import { useRouter } from "next/router"; import useSWR, { mutate } from "swr"; // hooks import { useUser } from "hooks/store"; import useUserAuth from "hooks/use-user-auth"; // services import { IntegrationService } from "services/integrations"; // components import { ImportExportSettingsLoader } from "components/ui"; import { DeleteImportModal, GithubImporterRoot, JiraImporterRoot, SingleImport } from "components/integration"; import { EmptyState } from "components/empty-state"; // ui import { Button } from "@plane/ui"; // icons import { RefreshCw } from "lucide-react"; // types import { IImporterService } from "@plane/types"; // constants import { IMPORTER_SERVICES_LIST } from "constants/fetch-keys"; import { IMPORTERS_LIST } from "constants/workspace"; import { EmptyStateType } from "constants/empty-state"; // 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 router = useRouter(); const { workspaceSlug, provider } = router.query; // store hooks const { currentUser, currentUserLoader } = useUser(); // custom hooks const {} = useUserAuth({ user: currentUser, isLoading: currentUserLoader }); 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} />
{(!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;