diff options
Diffstat (limited to 'lib/email-template/editor/template-editor.tsx')
| -rw-r--r-- | lib/email-template/editor/template-editor.tsx | 45 |
1 files changed, 23 insertions, 22 deletions
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 ( <div className="flex flex-1 flex-col gap-4 p-4 md:gap-8 md:p-8"> @@ -48,12 +49,12 @@ export function TemplateEditor({ templateSlug, initialTemplate }: TemplateEditor </Badge> {template.category && ( <Badge variant="secondary" className="text-xs"> - {template.category} + {getCategoryDisplayName(template.category)} </Badge> )} </div> <p className="text-sm text-muted-foreground"> - {template.description || "템플릿 편집"} + {template.description || '템플릿 편집'} </p> </div> @@ -171,4 +172,4 @@ export function TemplateEditor({ templateSlug, initialTemplate }: TemplateEditor </div> </div> ) -}
\ No newline at end of file +} |
