- 가맹점관리 _ 등록 현황 온라인 등록현황 Enum Value 다국어 적용, 발급일자 포맷 지정
This commit is contained in:
13
src/entities/merchant/model/constant.ts
Normal file
13
src/entities/merchant/model/constant.ts
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
import { TFunction } from 'i18next';
|
||||||
|
import { UsageStatus } from './types';
|
||||||
|
|
||||||
|
export const getUsageStatusName = (t: TFunction, usageStatus?: string): string => {
|
||||||
|
if (!usageStatus) return '';
|
||||||
|
|
||||||
|
const statusMap: Record<string, string> = {
|
||||||
|
[UsageStatus.AVAILABLE]: t('merchant.available'),
|
||||||
|
[UsageStatus.SUSPENDED]: t('merchant.suspended'),
|
||||||
|
};
|
||||||
|
|
||||||
|
return statusMap[usageStatus] || usageStatus;
|
||||||
|
};
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
import moment from 'moment';
|
import moment from 'moment';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
import { OnlineInfomation } from '../../model/types';
|
import { OnlineInfomation } from '../../model/types';
|
||||||
|
import { getUsageStatusName } from '../../model/constant';
|
||||||
|
|
||||||
export interface OnlineSectionProps {
|
export interface OnlineSectionProps {
|
||||||
data?: OnlineInfomation
|
data?: OnlineInfomation
|
||||||
@@ -18,7 +19,7 @@ export const OnlineSection = ({
|
|||||||
<ul className="kv-list">
|
<ul className="kv-list">
|
||||||
<li className="kv-row">
|
<li className="kv-row">
|
||||||
<span className="k">{t('merchant.status')}</span>
|
<span className="k">{t('merchant.status')}</span>
|
||||||
<span className="v">{ data?.usageStatus }</span>
|
<span className="v">{ getUsageStatusName(t, data?.usageStatus) }</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="kv-row">
|
<li className="kv-row">
|
||||||
<span className="k">{t('merchant.companyName')}</span>
|
<span className="k">{t('merchant.companyName')}</span>
|
||||||
@@ -30,7 +31,7 @@ export const OnlineSection = ({
|
|||||||
</li>
|
</li>
|
||||||
<li className="kv-row">
|
<li className="kv-row">
|
||||||
<span className="k">{t('merchant.issueDate')}</span>
|
<span className="k">{t('merchant.issueDate')}</span>
|
||||||
<span className="v">{ data?.registrationDate }</span>
|
<span className="v">{ data?.registrationDate ? `${moment(data?.registrationDate).format('YYYY.MM.DD')}`: '' }</span>
|
||||||
</li>
|
</li>
|
||||||
<li className="kv-row">
|
<li className="kv-row">
|
||||||
<span className="k">{t('merchant.contractStatus')}</span>
|
<span className="k">{t('merchant.contractStatus')}</span>
|
||||||
|
|||||||
@@ -1313,6 +1313,8 @@
|
|||||||
"businessAddress": "Business Address",
|
"businessAddress": "Business Address",
|
||||||
"websiteUrl": "Website URL",
|
"websiteUrl": "Website URL",
|
||||||
"onlineRegistrationStatus": "Online Registration Status",
|
"onlineRegistrationStatus": "Online Registration Status",
|
||||||
|
"available": "Available",
|
||||||
|
"suspended": "Suspended",
|
||||||
"status": "Status",
|
"status": "Status",
|
||||||
"issueDate": "Issue Date",
|
"issueDate": "Issue Date",
|
||||||
"contractStatus": "Contract Status",
|
"contractStatus": "Contract Status",
|
||||||
|
|||||||
@@ -1314,6 +1314,8 @@
|
|||||||
"businessAddress": "사업장주소",
|
"businessAddress": "사업장주소",
|
||||||
"websiteUrl": "홈페이지 주소",
|
"websiteUrl": "홈페이지 주소",
|
||||||
"onlineRegistrationStatus": "온라인 등록현황",
|
"onlineRegistrationStatus": "온라인 등록현황",
|
||||||
|
"available": "사용 가능",
|
||||||
|
"suspended": "사용 중지",
|
||||||
"status": "상태",
|
"status": "상태",
|
||||||
"issueDate": "발급일자",
|
"issueDate": "발급일자",
|
||||||
"contractStatus": "계약완료 여부",
|
"contractStatus": "계약완료 여부",
|
||||||
|
|||||||
Reference in New Issue
Block a user