From 08b73d56c2d887931cecdf2b0af6b277381763e6 Mon Sep 17 00:00:00 2001 From: joonhoekim <26rote@gmail.com> Date: Thu, 6 Nov 2025 17:44:59 +0900 Subject: (김준회) 결재 프리뷰 공통컴포넌트 작성 및 index.ts --> client.ts 분리 (서버사이드 코드가 번들링되어 클라측에서 실행되는 문제 해결 목적) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/approval/template-utils.ts | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) (limited to 'lib/approval/template-utils.ts') diff --git a/lib/approval/template-utils.ts b/lib/approval/template-utils.ts index a39f8ac4..0607f289 100644 --- a/lib/approval/template-utils.ts +++ b/lib/approval/template-utils.ts @@ -108,13 +108,13 @@ export async function htmlTableConverter( columns: Array<{ key: string; label: string }> ): Promise { if (!data || data.length === 0) { - return '

데이터가 없습니다.

'; + return '

데이터가 없습니다.

'; } const headerRow = columns .map( (col) => - `${col.label}` + `${col.label}` ) .join(''); @@ -125,7 +125,7 @@ export async function htmlTableConverter( const value = row[col.key]; const displayValue = value !== undefined && value !== null ? String(value) : '-'; - return `${displayValue}`; + return `${displayValue}`; }) .join(''); return `${cells}`; @@ -133,7 +133,7 @@ export async function htmlTableConverter( .join(''); return ` - +
${headerRow} @@ -162,19 +162,19 @@ export async function htmlListConverter( ordered: boolean = false ): Promise { if (!items || items.length === 0) { - return '

항목이 없습니다.

'; + return '

항목이 없습니다.

'; } const listItems = items - .map((item) => `
  • ${item}
  • `) + .map((item) => `
  • ${item}
  • `) .join(''); const tag = ordered ? 'ol' : 'ul'; - const listClass = ordered - ? 'list-decimal list-inside my-4' - : 'list-disc list-inside my-4'; + const listStyle = ordered + ? 'list-style-type: decimal; list-style-position: inside; margin: 16px 0; padding-left: 20px;' + : 'list-style-type: disc; list-style-position: inside; margin: 16px 0; padding-left: 20px;'; - return `<${tag} class="${listClass}">${listItems}`; + return `<${tag} style="${listStyle}">${listItems}`; } /** @@ -196,20 +196,20 @@ export async function htmlDescriptionList( items: Array<{ label: string; value: string }> ): Promise { if (!items || items.length === 0) { - return '

    정보가 없습니다.

    '; + return '

    정보가 없습니다.

    '; } const listItems = items .map( (item) => ` -
    -
    ${item.label}
    -
    ${item.value}
    +
    +
    ${item.label}
    +
    ${item.value}
    ` ) .join(''); - return `
    ${listItems}
    `; + return `
    ${listItems}
    `; } -- cgit v1.2.3