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 { Exporter, SingleExport } from "components/exporter"; // ui import { Icon, Loader, PrimaryButton } from "components/ui"; // icons import { ArrowPathIcon } from "@heroicons/react/24/outline"; // fetch-keys import { EXPORT_SERVICES_LIST } from "constants/fetch-keys"; // constants import { EXPORTERS_LIST } from "constants/workspace"; const IntegrationGuide = () => { const [refreshing, setRefreshing] = useState(false); const per_page = 10; const [cursor, setCursor] = useState(`10:0:0`); const router = useRouter(); const { workspaceSlug, provider } = router.query; const { user } = useUserAuth(); const { data: exporterServices } = useSWR( workspaceSlug && cursor ? EXPORT_SERVICES_LIST(workspaceSlug as string, cursor, `${per_page}`) : null, workspaceSlug && cursor ? () => IntegrationService.getExportsServicesList(workspaceSlug as string, cursor, per_page) : null ); const handleCsvClose = () => { router.replace(`/plane/settings/exports`); }; return ( <>
<>
{EXPORTERS_LIST.map((service) => (
{`${service.title}

{service.title}

{service.description}

))}

Previous Exports

{exporterServices && exporterServices?.results ? ( exporterServices?.results?.length > 0 ? (
{exporterServices?.results.map((service) => ( ))}
) : (

No previous export available.

) ) : ( )}
{provider && ( handleCsvClose()} data={null} user={user} provider={provider} mutateServices={() => mutate(EXPORT_SERVICES_LIST(workspaceSlug as string, `${cursor}`, `${per_page}`)) } /> )}
); }; export default IntegrationGuide;