261001_01_ENH: 문자 템플릿 JPG 첨부 및 MMS 이미지 미리보기 추가
This commit is contained in:
@@ -11,6 +11,7 @@ import { useDialog } from '@/hooks/useDialog'
|
||||
import {
|
||||
useMainTemplateIdxQuery,
|
||||
useSendSingleMessageMutation,
|
||||
useTemplateAttachmentImagesQuery,
|
||||
useTemplateListQuery,
|
||||
useTemplateQuery,
|
||||
} from '@/query/message'
|
||||
@@ -20,7 +21,12 @@ import { sanitizeEmailHtml } from '@/components/message-template/emailHtmlPolicy
|
||||
import { getNearestFutureDateTime } from '@/lib/datetime'
|
||||
import { escapeHtml, substituteVariables } from '@/lib/variableSubstitution'
|
||||
import type { DialogId } from '@/store/jotai/dialog'
|
||||
import type { MessageSendChannel, PhoneVerificationSendData, TemplateEmailWithAttachments } from '@/types/message'
|
||||
import type {
|
||||
MessageSendChannel,
|
||||
PhoneVerificationSendData,
|
||||
TemplateEmailWithAttachments,
|
||||
TemplateSmsWithAttachments,
|
||||
} from '@/types/message'
|
||||
import TemplateAttachmentList from '@/components/message-template/TemplateAttachmentList'
|
||||
import {PHONE_VERIFICATION_PREVIEW_SUFFIX, TEMPLATE_PURPOSE} from '@/const/messageTemplateConst'
|
||||
|
||||
@@ -69,6 +75,11 @@ const SingleMessageSendDialog = ({
|
||||
const templateList: TemplateSummary[] = templateListQuery.data ?? []
|
||||
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
|
||||
|
||||
@@ -248,6 +259,8 @@ const SingleMessageSendDialog = ({
|
||||
className="max-w-80 mx-0"
|
||||
debounceMs={600}
|
||||
smsTitle={resolvedTitle}
|
||||
smsHasAttachment={smsAttachmentNames.length > 0}
|
||||
smsImages={smsAttachmentImages}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
|
||||
Reference in New Issue
Block a user