import { FC, useState } from "react"; import Link from "next/link"; import Image from "next/image"; import { useRouter } from "next/router"; import { mutate } from "swr"; // icons import { ArrowRightIcon } from "components/icons"; // components import { GithubIntegrationRoot } from "components/integration"; // icons import { ArrowPathIcon } from "@heroicons/react/24/outline"; // ui import { Loader, PrimaryButton, SecondaryButton } from "components/ui"; // images import GithubLogo from "public/logos/github-square.png"; // helpers import { renderShortDateWithYearFormat } from "helpers/date-time.helper"; // types import { IAppIntegrations, IImporterService, IWorkspaceIntegrations } from "types"; // fetch-keys import { IMPORTER_SERVICES_LIST } from "constants/fetch-keys"; type Props = { provider: string | undefined; appIntegrations: IAppIntegrations[] | undefined; workspaceIntegrations: IWorkspaceIntegrations[] | undefined; importerServices: IImporterService[] | undefined; }; const importersList: { [key: string]: string } = { github: "GitHub", }; const IntegrationGuide: FC = ({ provider, appIntegrations, workspaceIntegrations, importerServices, }) => { const [refreshing, setRefreshing] = useState(false); const router = useRouter(); const { workspaceSlug } = router.query; return (
{!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
{appIntegrations ? ( appIntegrations.length > 0 ? ( appIntegrations.map((integration, index) => (
{integration?.provider === "github" && ( GithubLogo )}

{integration?.title}

Activate GitHub integrations on individual projects to sync with specific repositories.
Integrate Now

Previous Imports

{importerServices ? ( importerServices.length > 0 ? (
{importerServices.map((service) => (

Import from{" "} {importersList[service.service]} {" "} to{" "} {service.project_detail.name} {refreshing ? "Refreshing..." : service.status}

{renderShortDateWithYearFormat(service.created_at)}| Imported by{" "} {service.initiated_by_detail.first_name && service.initiated_by_detail.first_name !== "" ? service.initiated_by_detail.first_name + " " + service.initiated_by_detail.last_name : service.initiated_by_detail.email}
))}
) : (
No previous imports available.
) ) : ( )}
)) ) : (
Integrations not available.
) ) : ( )}
)} {provider && provider === "github" && ( )}
); }; export default IntegrationGuide;