diff options
| author | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-21 07:19:52 +0000 |
|---|---|---|
| committer | dujinkim <dujin.kim@dtsolution.co.kr> | 2025-07-21 07:19:52 +0000 |
| commit | 9da494b0e3bbe7b513521d0915510fe9ee376b8b (patch) | |
| tree | f936f69626bf2808ac409ce7cad97433465b3672 /app | |
| parent | e275618ff8a1ce6977d3e2567d943edb941897f9 (diff) | |
(대표님, 최겸) 작업사항 - 이메일 템플릿, 메일링, 기술영업 요구사항 반영
Diffstat (limited to 'app')
| -rw-r--r-- | app/[lng]/evcp/(evcp)/email-template/[name]/page.tsx | 26 | ||||
| -rw-r--r-- | app/[lng]/evcp/(evcp)/email-template/[slug]/page.tsx | 44 | ||||
| -rw-r--r-- | app/[lng]/evcp/(evcp)/email-template/page.tsx | 89 |
3 files changed, 116 insertions, 43 deletions
diff --git a/app/[lng]/evcp/(evcp)/email-template/[name]/page.tsx b/app/[lng]/evcp/(evcp)/email-template/[name]/page.tsx deleted file mode 100644 index cccc10fc..00000000 --- a/app/[lng]/evcp/(evcp)/email-template/[name]/page.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { getTemplateAction } from '@/lib/mail/service';
-import MailTemplateEditorClient from '@/components/mail/mail-template-editor-client';
-
-interface EditMailTemplatePageProps {
- params: {
- name: string;
- lng: string;
- };
-}
-
-export default async function EditMailTemplatePage({ params }: EditMailTemplatePageProps) {
- const { name: templateName } = await params;
-
- // 서버에서 초기 템플릿 데이터 가져오기
- const result = await getTemplateAction(templateName);
- const initialTemplate = result.success ? result.data : null;
-
- return (
- <div className="container mx-auto p-6">
- <MailTemplateEditorClient
- templateName={templateName}
- initialTemplate={initialTemplate}
- />
- </div>
- );
-}
diff --git a/app/[lng]/evcp/(evcp)/email-template/[slug]/page.tsx b/app/[lng]/evcp/(evcp)/email-template/[slug]/page.tsx new file mode 100644 index 00000000..713c2b6d --- /dev/null +++ b/app/[lng]/evcp/(evcp)/email-template/[slug]/page.tsx @@ -0,0 +1,44 @@ +import * as React from "react"
+import { type Metadata } from "next"
+import { notFound } from "next/navigation"
+
+import { getTemplateAction } from "@/lib/email-template/service"
+import { TemplateEditor } from "@/lib/email-template/editor/template-editor"
+
+interface TemplateDetailPageProps {
+ params: {
+ slug: string
+ }
+}
+
+export async function generateMetadata({ params }: TemplateDetailPageProps): Promise<Metadata> {
+ const result = await getTemplateAction(params.slug)
+
+ if (!result.success || !result.data) {
+ return {
+ title: "템플릿을 찾을 수 없음",
+ }
+ }
+
+ return {
+ title: `${result.data.name} - 템플릿 편집`,
+ description: result.data.description || `${result.data.name} 템플릿을 편집합니다.`,
+ }
+}
+
+export default async function TemplateDetailPage({ params }: TemplateDetailPageProps) {
+ const result = await getTemplateAction(params.slug)
+
+ if (!result.success || !result.data) {
+ notFound()
+ }
+
+ return (
+ <div className="flex flex-1 flex-col">
+ <TemplateEditor
+ templateSlug={params.slug}
+ initialTemplate={result.data}
+ />
+ </div>
+ )
+}
\ No newline at end of file diff --git a/app/[lng]/evcp/(evcp)/email-template/page.tsx b/app/[lng]/evcp/(evcp)/email-template/page.tsx index d66b1588..7f4de341 100644 --- a/app/[lng]/evcp/(evcp)/email-template/page.tsx +++ b/app/[lng]/evcp/(evcp)/email-template/page.tsx @@ -1,22 +1,77 @@ -import { getTemplatesAction } from '@/lib/mail/service';
-import MailTemplatesClient from '@/components/mail/mail-templates-client';
-import { InformationButton } from '@/components/information/information-button';
-export default async function MailTemplatesPage() {
- // 서버에서 초기 데이터 가져오기
- const result = await getTemplatesAction();
- const initialData = result.success ? result.data : [];
+import * as React from "react"
+import { type Metadata } from "next"
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card"
+import { getTemplateList } from "@/lib/email-template/service"
+import { type SearchParams } from "@/types/table"
+import { SearchParamsEmailTemplateCache } from "@/lib/email-template/validations"
+import { TemplateTable } from "@/lib/email-template/table/email-template-table"
+import { Shell } from "@/components/shell"
+import { getValidFilters } from "@/lib/data-table"
+import { Skeleton } from "@/components/ui/skeleton"
+import { DataTableSkeleton } from "@/components/data-table/data-table-skeleton"
+
+export const metadata: Metadata = {
+ title: "템플릿 관리",
+ description: "이메일 템플릿을 관리하고 편집합니다.",
+}
+
+interface TemplatePageProps {
+ searchParams: SearchParams
+}
+
+export default async function TemplatePage(props: TemplatePageProps) {
+
+ const searchParams = await props.searchParams
+
+ const search = SearchParamsEmailTemplateCache.parse(searchParams)
+ const validFilters = getValidFilters(search.filters)
+
+
+ const promises = Promise.all([
+ getTemplateList({
+ ...search,
+ filters: validFilters,
+ }),
+
+ ])
return (
- <div className="container mx-auto p-6">
- <div className="mb-8">
- <div className="flex items-center gap-2">
- <h1 className="text-3xl font-bold text-gray-900 mb-2">메일 템플릿 관리</h1>
- <InformationButton pagePath="evcp/email-template" />
+
+ <Shell className="gap-2">
+ <div className="flex items-center justify-between space-y-2">
+ <div className="flex items-center justify-between space-y-2">
+ <div>
+ <div className="flex items-center gap-2">
+ <h2 className="text-2xl font-bold tracking-tight">
+ 이메일 템플릿 관리
+ </h2>
+ {/* <InformationButton pagePath="evcp/equip-class" /> */}
+ </div>
+ </div>
</div>
- {/* <p className="text-gray-600">이메일 템플릿을 관리할 수 있습니다.</p> */}
</div>
- <MailTemplatesClient initialData={initialData} />
- </div>
- );
-}
+ <React.Suspense fallback={<Skeleton className="h-7 w-52" />}>
+ </React.Suspense>
+ <React.Suspense
+ fallback={
+ <DataTableSkeleton
+ columnCount={6}
+ searchableColumnCount={1}
+ filterableColumnCount={2}
+ cellWidths={["10rem", "40rem", "12rem", "12rem", "8rem", "8rem"]}
+ shrinkZero
+ />
+ }
+ >
+ <TemplateTable promises={promises} />
+ </React.Suspense>
+ </Shell>
+ )
+}
\ No newline at end of file |
