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";
|
|
|
|
// components
|
2023-08-14 06:14:17 +00:00
|
|
|
import ExportGuide from "components/exporter/guide";
|
2023-09-15 09:33:32 +00:00
|
|
|
import { SettingsSidebar } from "components/project";
|
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
|
|
|
|
/>
|
2023-08-14 06:14:17 +00:00
|
|
|
<BreadcrumbItem title="Export Settings" unshrinkTitle />
|
2023-04-05 19:21:15 +00:00
|
|
|
</Breadcrumbs>
|
|
|
|
}
|
|
|
|
>
|
2023-09-15 14:00:53 +00:00
|
|
|
<div className="flex flex-row gap-2 h-full">
|
|
|
|
<div className="w-80 pt-8 overflow-y-hidden flex-shrink-0">
|
2023-09-15 09:33:32 +00:00
|
|
|
<SettingsSidebar />
|
|
|
|
</div>
|
2023-09-15 14:00:53 +00:00
|
|
|
<div className="pr-9 py-8 w-full overflow-y-auto">
|
2023-09-15 09:33:32 +00:00
|
|
|
<div className="flex items-center py-3.5 border-b border-custom-border-200">
|
|
|
|
<h3 className="text-xl font-medium">Exports</h3>
|
|
|
|
</div>
|
|
|
|
<ExportGuide />
|
|
|
|
</div>
|
2023-05-05 11:37:29 +00:00
|
|
|
</div>
|
2023-04-08 08:16:46 +00:00
|
|
|
</WorkspaceAuthorizationLayout>
|
2023-03-23 17:57:11 +00:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default ImportExport;
|