261008_01_ENH: 알림톡 템플릿 관련내용 구현 및 발송 구현
This commit is contained in:
@@ -11,7 +11,7 @@ import { useSendResultBySidQuery } from '@/query/message'
|
||||
import { useInternalInfoQuery } from '@/query/internal'
|
||||
import { clientEnv } from '@/lib/env.client'
|
||||
import { ChannelType } from '@kri/common/noti-hub'
|
||||
import type { SendResultInfo } from '@/types/message'
|
||||
import type { SendResultInfo } from '@kri/common/noti-hub'
|
||||
import { formatKst } from '@kri/common'
|
||||
import { type ResultCode, ResultCodeType } from '@/types/project'
|
||||
import { CONTACT_INTERVIEWER_ROLE, FIELD_INTERVIEWER_ROLE } from '@/const/userConst'
|
||||
@@ -272,13 +272,14 @@ const SendResultTable = ({ isLoading, results }: { isLoading: boolean; results:
|
||||
}
|
||||
|
||||
const SendResultHistory = ({ sid, prjctCd }: { sid: string; prjctCd: string }) => {
|
||||
const [tab, setTab] = useState<'email' | 'sms'>('email')
|
||||
const [tab, setTab] = useState<'email' | 'sms' | 'kko'>('email')
|
||||
|
||||
const emailQuery = useSendResultBySidQuery(sid, prjctCd, clientEnv.REQUEST_SVC, ChannelType.EMAIL, tab === 'email')
|
||||
const smsQuery = useSendResultBySidQuery(sid, prjctCd, clientEnv.REQUEST_SVC, ChannelType.SMS, tab === 'sms')
|
||||
const activeQuery = tab === 'email' ? emailQuery : smsQuery
|
||||
const kkoQuery = useSendResultBySidQuery(sid, prjctCd, clientEnv.REQUEST_SVC, ChannelType.KKO, tab === 'kko')
|
||||
const activeQuery = tab === 'email' ? emailQuery : tab === 'sms' ? smsQuery : kkoQuery
|
||||
|
||||
const handleTabClick = (e: React.MouseEvent, next: 'email' | 'sms') => {
|
||||
const handleTabClick = (e: React.MouseEvent, next: 'email' | 'sms' | 'kko') => {
|
||||
e.stopPropagation()
|
||||
setTab(next)
|
||||
}
|
||||
@@ -307,6 +308,14 @@ const SendResultHistory = ({ sid, prjctCd }: { sid: string; prjctCd: string }) =
|
||||
>
|
||||
문자
|
||||
</Button>
|
||||
<Button
|
||||
type="button"
|
||||
size="sm"
|
||||
variant={tab === 'kko' ? 'default' : 'outline'}
|
||||
onClick={(e) => handleTabClick(e, 'kko')}
|
||||
>
|
||||
알림톡
|
||||
</Button>
|
||||
<RefreshIconButton onRefresh={() => activeQuery.refetch()} isFetching={activeQuery.isFetching} />
|
||||
</div>
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user