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 { Exporter, SingleExport } from "components/exporter"; // ui import { Button, Loader } from "@plane/ui"; // icons import { MoveLeft, MoveRight, RefreshCw } from "lucide-react"; // fetch-keys import { EXPORT_SERVICES_LIST } from "constants/fetch-keys"; // constants import { EXPORTERS_LIST } from "constants/workspace"; // services const integrationService = new IntegrationService(); 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(`/${workspaceSlug?.toString()}/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;