From bb461fa9fbefa1895dd0e49eba8f7eebe4906cb4 Mon Sep 17 00:00:00 2001 From: Maze Winther Date: Sat, 16 Aug 2025 21:44:23 +0200 Subject: [PATCH] refactor: move export button to component --- apps/web/src/components/editor-header.tsx | 41 +--------------- apps/web/src/components/export-button.tsx | 58 +++++++++++++++++++++++ 2 files changed, 59 insertions(+), 40 deletions(-) create mode 100644 apps/web/src/components/export-button.tsx diff --git a/apps/web/src/components/editor-header.tsx b/apps/web/src/components/editor-header.tsx index 6881c135..ee5dfc17 100644 --- a/apps/web/src/components/editor-header.tsx +++ b/apps/web/src/components/editor-header.tsx @@ -19,9 +19,8 @@ import { DeleteProjectDialog } from "./delete-project-dialog"; import { useRouter } from "next/navigation"; import { FaDiscord } from "react-icons/fa6"; import { useTheme } from "next-themes"; -import { TransitionUpIcon } from "./icons"; import { PanelPresetSelector } from "./panel-preset-selector"; -import { Dialog, DialogContent, DialogHeader, DialogTitle } from "./ui/dialog"; +import { ExportButton } from "./export-button"; export function EditorHeader() { const { activeProject, renameProject, deleteProject } = useProjectStore(); @@ -138,41 +137,3 @@ export function EditorHeader() { /> ); } - -function ExportButton() { - const [isExportDialogOpen, setIsExportDialogOpen] = useState(false); - - const handleExport = () => { - setIsExportDialogOpen(true); - }; - - return ( - <> - - - - - Export Project - -
-

- Export functionality is not ready yet. We're currently working on - a custom pipeline to make this possible. -

-
-
-
- - ); -} diff --git a/apps/web/src/components/export-button.tsx b/apps/web/src/components/export-button.tsx new file mode 100644 index 00000000..0e1c8774 --- /dev/null +++ b/apps/web/src/components/export-button.tsx @@ -0,0 +1,58 @@ +"use client"; + +import { useState } from "react"; +import { TransitionUpIcon } from "./icons"; +import { Dialog, DialogContent, DialogHeader, DialogTitle } from "./ui/dialog"; + +export function ExportButton() { + const [isExportDialogOpen, setIsExportDialogOpen] = useState(false); + + const handleExport = () => { + setIsExportDialogOpen(true); + }; + + return ( + <> + + + + ); +} + +function ExportDialog({ + isOpen, + onOpenChange, +}: { + isOpen: boolean; + onOpenChange: (open: boolean) => void; +}) { + return ( + + + + Export Project + +
+

+ Export functionality is not ready yet. We're currently working on a + custom pipeline to make this possible. +

+
+
+
+ ); +}