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 { MoveLeft, MoveRight, RefreshCw } from "lucide-react"; import { Button } from "@plane/ui"; import { EmptyState } from "@/components/empty-state"; import { Exporter, SingleExport } from "@/components/exporter"; import { ImportExportSettingsLoader } from "@/components/ui"; import { EmptyStateType } from "@/constants/empty-state"; import { EXPORT_SERVICES_LIST } from "@/constants/fetch-keys"; import { EXPORTERS_LIST } from "@/constants/workspace"; import { useUser } from "@/hooks/store"; import useUserAuth from "@/hooks/use-user-auth"; // services import { IntegrationService } from "@/services/integrations"; // components // ui // icons // constants // services const integrationService = new IntegrationService(); const IntegrationGuide = observer(() => { // states const [refreshing, setRefreshing] = useState(false); const per_page = 10; const [cursor, setCursor] = useState(`10:0:0`); // 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: 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) => ( ))}
) : (
) ) : ( )}
{provider && ( handleCsvClose()} data={null} user={currentUser} provider={provider} mutateServices={() => mutate(EXPORT_SERVICES_LIST(workspaceSlug as string, `${cursor}`, `${per_page}`))} /> )}
); }); export default IntegrationGuide;