From 1b715c5f8b3416ffc9f80c9f750149d1309811b9 Mon Sep 17 00:00:00 2001 From: web Date: Wed, 17 Sep 2025 02:29:29 -0700 Subject: [PATCH] =?UTF-8?q?=E2=99=BB=EF=B8=8F=20refactor:=20Simplify=20Tem?= =?UTF-8?q?platePreview=20component=20structure=20by=20consolidating=20She?= =?UTF-8?q?et=20and=20Button=20elements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dashboard/subscribe/template-preview.tsx | 64 ++++++++++--------- 1 file changed, 33 insertions(+), 31 deletions(-) diff --git a/apps/admin/app/dashboard/subscribe/template-preview.tsx b/apps/admin/app/dashboard/subscribe/template-preview.tsx index 35354ac..61933f3 100644 --- a/apps/admin/app/dashboard/subscribe/template-preview.tsx +++ b/apps/admin/app/dashboard/subscribe/template-preview.tsx @@ -3,7 +3,13 @@ import { previewSubscribeTemplate } from '@/services/admin/application'; import { useQuery } from '@tanstack/react-query'; import { Button } from '@workspace/ui/components/button'; -import { Sheet, SheetContent, SheetHeader, SheetTitle } from '@workspace/ui/components/sheet'; +import { + Sheet, + SheetContent, + SheetHeader, + SheetTitle, + SheetTrigger, +} from '@workspace/ui/components/sheet'; import { MonacoEditor } from '@workspace/ui/custom-components/editor/monaco-editor'; import { Icon } from '@workspace/ui/custom-components/icon'; import { useTranslations } from 'next-intl'; @@ -68,36 +74,32 @@ export function TemplatePreview({ applicationId, output_format }: TemplatePrevie } }; - const handleOpenChange = (newOpen: boolean) => { - setIsOpen(newOpen); - }; - return ( - <> - - - - - - - {isLoading ? ( -
- - {t('loading')} -
- ) : ( - - )} -
-
- + + + + + + + + + {isLoading ? ( +
+ + {t('loading')} +
+ ) : ( + + )} +
+
); }