From fb20768fa881841d3f80d12a276a9445feb6f514 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Tue, 30 Sep 2025 05:04:33 +0000 Subject: (고건) 이메일 템플릿 정보 수정/복제 기능 에러 수정 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/email-template/editor/template-editor.tsx | 45 ++++++++++++++------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'lib/email-template/editor/template-editor.tsx') diff --git a/lib/email-template/editor/template-editor.tsx b/lib/email-template/editor/template-editor.tsx index dc77a558..a22fb059 100644 --- a/lib/email-template/editor/template-editor.tsx +++ b/lib/email-template/editor/template-editor.tsx @@ -1,35 +1,36 @@ -"use client" +'use client'; -import * as React from "react" -import { useRouter } from "next/navigation" -import { ArrowLeft, Save, Edit, Settings, List } from "lucide-react" -import Link from "next/link" - -import { Button } from "@/components/ui/button" +/* IMPORT */ +import { ArrowLeft, Edit, List, Settings } from 'lucide-react'; +import { Badge } from '@/components/ui/badge'; +import { Button } from '@/components/ui/button'; import { Card, CardContent, CardDescription, CardHeader, CardTitle, -} from "@/components/ui/card" -import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs" -import { Separator } from "@/components/ui/separator" -import { Badge } from "@/components/ui/badge" +} from '@/components/ui/card'; +import { getCategoryDisplayName } from '../validations'; +import Link from 'next/link'; +import { Separator } from '@/components/ui/separator'; +import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; +import { TemplateContentEditor } from './template-content-editor'; +import { TemplateSettings } from './template-settings'; +import { TemplateVariableManager } from './template-variable-manager'; +import { type TemplateWithVariables } from '@/db/schema'; +import { useState } from 'react'; -import { type TemplateWithVariables } from "@/db/schema" -import { TemplateContentEditor } from "./template-content-editor" -import { TemplateVariableManager } from "./template-variable-manager" -import { TemplateSettings } from "./template-settings" +// ---------------------------------------------------------------------------------------------------- +/* TYPES */ interface TemplateEditorProps { - templateSlug: string - initialTemplate: TemplateWithVariables + templateSlug: string; + initialTemplate: TemplateWithVariables; } export function TemplateEditor({ templateSlug, initialTemplate }: TemplateEditorProps) { - const router = useRouter() - const [template, setTemplate] = React.useState(initialTemplate) + const [template, setTemplate] = useState(initialTemplate); return (
@@ -48,12 +49,12 @@ export function TemplateEditor({ templateSlug, initialTemplate }: TemplateEditor {template.category && ( - {template.category} + {getCategoryDisplayName(template.category)} )}

- {template.description || "템플릿 편집"} + {template.description || '템플릿 편집'}

@@ -171,4 +172,4 @@ export function TemplateEditor({ templateSlug, initialTemplate }: TemplateEditor ) -} \ No newline at end of file +} -- cgit v1.2.3