261008_01_ENH: 알림톡 템플릿 관련내용 구현 및 발송 구현

This commit is contained in:
2026-10-08 11:20:42 +09:00
parent f12c374a84
commit 264707ac56
33 changed files with 803 additions and 143 deletions

View File

@@ -1,7 +1,7 @@
'use client'
import { useEffect, useRef, useState, type ReactNode } from 'react'
import { Mail, MessageSquare, Paperclip, Phone, QrCode } from 'lucide-react'
import { Mail, MessageCircle, MessageSquare, Paperclip, Phone, QrCode } from 'lucide-react'
import { Button } from '@/components/ui/button'
import { Input } from '@/components/ui/input'
import { Label } from '@/components/ui/label'
@@ -24,6 +24,7 @@ import { useCtiCallPhase } from '@/hooks/useCtiCallPhase'
import { cn } from '@/lib/utils'
import { downloadFile } from '@kri/common/browser'
import {
buildKkoVariableValues,
buildListContactVariableValues,
resolveListHeaderValue,
} from '@/components/list-contact/listContactVariables'
@@ -126,6 +127,8 @@ const ListContactInfoPanel = ({
const surveyResultByIdx = new Map((detail?.surveyResults ?? []).map((result) => [result.prjctSurveyIdx, result]))
const surveyUrlValues = buildListContactVariableValues(listHeaders, detail, sid)
// 알림톡은 #{설문명}도 설문 URL로 치환한다. 문자·메일은 기존처럼 헤더 값만 쓴다.
const kkoVariableValues = buildKkoVariableValues(surveyUrlValues, surveys)
const handleStartSurvey = (survey: ProjectSurvey) => {
if (!survey.surveyUrl) return
@@ -240,6 +243,16 @@ const ListContactInfoPanel = ({
<MessageSquare className="h-4 w-4" />
발송
</Button>
<Button
type="button"
variant="outline"
className="shrink-0 gap-2"
disabled={isEditing}
onClick={() => handleSend('kko', header.listHderId)}
>
<MessageCircle className="h-4 w-4" />
알림톡
</Button>
</div>
{(isDialing || isOnCall) &&
<p className="text-sm text-red-600 font-medium mt-1">
@@ -383,7 +396,7 @@ const ListContactInfoPanel = ({
itrntPrjctCd={itrntPrjctCd}
sid={sid}
destHeaderId={sendTarget?.headerId ?? 0}
variableValues={surveyUrlValues}
variableValues={sendTarget?.channel === 'kko' ? kkoVariableValues : surveyUrlValues}
/>
</div>
)