261001_01_ENH: 문자 템플릿 JPG 첨부 및 MMS 이미지 미리보기 추가
This commit is contained in:
@@ -12,6 +12,7 @@ import { useSelectedProject } from '@/hooks/useSelectedProject'
|
||||
import {
|
||||
useMainTemplateIdxQuery,
|
||||
useSendBulkMessageMutation,
|
||||
useTemplateAttachmentImagesQuery,
|
||||
useTemplateListQuery,
|
||||
useTemplateQuery,
|
||||
} from '@/query/message'
|
||||
@@ -28,7 +29,7 @@ import { normalizeQrCodeForEditor, renderQrCodePreviewHtml } from '@/components/
|
||||
import { sanitizeEmailHtml } from '@/components/message-template/emailHtmlPolicy'
|
||||
import { applyLinkPreviewClass } from '@/components/kri-editor/utils/linkPreview'
|
||||
import TemplateAttachmentList from '@/components/message-template/TemplateAttachmentList'
|
||||
import type { TemplateEmailWithAttachments, TemplateSummaryWithPurpose } from '@/types/message'
|
||||
import type { TemplateEmailWithAttachments, TemplateSmsWithAttachments, TemplateSummaryWithPurpose } from '@/types/message'
|
||||
import { TEMPLATE_PURPOSE } from '@/const/messageTemplateConst'
|
||||
|
||||
export type MessageSendMode = 'email' | 'sms'
|
||||
@@ -86,6 +87,11 @@ const MessageSendDialog = ({
|
||||
)
|
||||
const templateDetailQuery = useTemplateQuery(templateIdx ?? 0, enabled && !!templateIdx)
|
||||
const selectedTemplate = templateDetailQuery.data ?? null
|
||||
const smsAttachmentNames =
|
||||
chnnlTy === ChannelType.SMS
|
||||
? ((selectedTemplate as TemplateSmsWithAttachments | null)?.atchFl?.split('|').filter(Boolean) ?? [])
|
||||
: []
|
||||
const smsAttachmentImages = useTemplateAttachmentImagesQuery(selectedTemplate?.tmplatIdx ?? 0, smsAttachmentNames, enabled)
|
||||
const mainTemplateQuery = useMainTemplateIdxQuery(prjctIdx, chnnlTy, enabled)
|
||||
const mainTemplateIdx = mainTemplateQuery.data ?? null
|
||||
const selectedSids = useMemo(
|
||||
@@ -342,6 +348,8 @@ const MessageSendDialog = ({
|
||||
className="max-w-80 mx-0"
|
||||
debounceMs={600}
|
||||
smsTitle={(selectedTemplate as TemplateSms).tmplatTitle}
|
||||
smsHasAttachment={smsAttachmentNames.length > 0}
|
||||
smsImages={smsAttachmentImages}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user