2023-03-23 17:57:11 +00:00
|
|
|
import { useRouter } from "next/router";
|
2023-04-05 19:21:15 +00:00
|
|
|
|
2023-07-31 11:52:48 +00:00
|
|
|
import useSWR from "swr";
|
|
|
|
|
|
|
|
// services
|
|
|
|
import workspaceService from "services/workspace.service";
|
2023-03-23 17:57:11 +00:00
|
|
|
// layouts
|
2023-04-08 08:16:46 +00:00
|
|
|
import { WorkspaceAuthorizationLayout } from "layouts/auth-layout";
|
2023-05-05 11:37:29 +00:00
|
|
|
import { SettingsHeader } from "components/workspace";
|
2023-04-08 08:16:46 +00:00
|
|
|
// components
|
2023-03-23 17:57:11 +00:00
|
|
|
import IntegrationGuide from "components/integration/guide";
|
2023-07-31 11:52:48 +00:00
|
|
|
import { IntegrationAndImportExportBanner } from "components/ui";
|
2023-03-23 17:57:11 +00:00
|
|
|
// ui
|
|
|
|
import { BreadcrumbItem, Breadcrumbs } from "components/breadcrumbs";
|
|
|
|
// types
|
2023-04-08 08:16:46 +00:00
|
|
|
import type { NextPage } from "next";
|
2023-07-31 11:52:48 +00:00
|
|
|
// fetch-keys
|
|
|
|
import { WORKSPACE_DETAILS } from "constants/fetch-keys";
|
|
|
|
// helper
|
|
|
|
import { truncateText } from "helpers/string.helper";
|
2023-03-23 17:57:11 +00:00
|
|
|
|
2023-04-08 08:16:46 +00:00
|
|
|
const ImportExport: NextPage = () => {
|
2023-03-23 17:57:11 +00:00
|
|
|
const router = useRouter();
|
2023-04-07 07:57:57 +00:00
|
|
|
const { workspaceSlug } = router.query;
|
2023-03-23 17:57:11 +00:00
|
|
|
|
2023-07-31 11:52:48 +00:00
|
|
|
const { data: activeWorkspace } = useSWR(
|
|
|
|
workspaceSlug ? WORKSPACE_DETAILS(workspaceSlug as string) : null,
|
|
|
|
() => (workspaceSlug ? workspaceService.getWorkspace(workspaceSlug as string) : null)
|
|
|
|
);
|
|
|
|
|
2023-03-23 17:57:11 +00:00
|
|
|
return (
|
2023-04-08 08:16:46 +00:00
|
|
|
<WorkspaceAuthorizationLayout
|
2023-04-05 19:21:15 +00:00
|
|
|
breadcrumbs={
|
|
|
|
<Breadcrumbs>
|
2023-07-31 11:52:48 +00:00
|
|
|
<BreadcrumbItem
|
|
|
|
title={`${truncateText(activeWorkspace?.name ?? "Workspace", 32)}`}
|
|
|
|
link={`/${workspaceSlug}`}
|
|
|
|
linkTruncate
|
|
|
|
/>
|
|
|
|
<BreadcrumbItem title="Import/ Export Settings" unshrinkTitle />
|
2023-04-05 19:21:15 +00:00
|
|
|
</Breadcrumbs>
|
|
|
|
}
|
|
|
|
>
|
2023-05-18 13:37:01 +00:00
|
|
|
<div className="p-8 space-y-4">
|
2023-05-05 11:37:29 +00:00
|
|
|
<SettingsHeader />
|
2023-05-18 13:37:01 +00:00
|
|
|
<IntegrationAndImportExportBanner bannerName="Import/ Export" />
|
2023-05-05 11:37:29 +00:00
|
|
|
<IntegrationGuide />
|
|
|
|
</div>
|
2023-04-08 08:16:46 +00:00
|
|
|
</WorkspaceAuthorizationLayout>
|
2023-03-23 17:57:11 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ImportExport;
|