261023_02_ENH: 자동완성 옵션 툴팁 동작 수정 및 MMS 배지 색상 구분과 색상 함수 분리

This commit is contained in:
2026-10-23 11:43:48 +09:00
parent 24a59057a5
commit 7b57ff2c5f
4 changed files with 40 additions and 26 deletions

View File

@@ -41,6 +41,17 @@ export function KriEditorSms({
const messageType: 'SMS' | 'LMS' | 'MMS' = smsHasAttachment ? 'MMS' : byteSize >= smsMaxBytes || Boolean(smsTitle) ? 'LMS' : 'SMS'
const maxBytes = messageType === 'SMS' ? smsMaxBytes : lmsMaxBytes
function getBadgeColor(): string {
switch (messageType) {
case 'SMS':
return 'bg-red-500'
case 'LMS':
return 'bg-blue-500'
case 'MMS':
return 'bg-green-500'
}
}
const commitText = React.useCallback((next: string, immediate = false) => {
setText(next)
latestTextRef.current = next
@@ -89,7 +100,7 @@ export function KriEditorSms({
<div className="flex h-full flex-col bg-gray-50 px-4 pt-8 pb-4">
<div className="mb-3 flex items-center justify-between px-2">
<span className="text-xs font-medium text-gray-600">{byteSize}/{maxBytes}byte</span>
<span className={cn('rounded-md px-3 py-1 text-xs font-bold text-white', messageType === 'SMS' ? 'bg-red-500' : 'bg-blue-500')}>
<span className={cn('rounded-md px-3 py-1 text-xs font-bold text-white', getBadgeColor())}>
{messageType}
</span>
</div>