[offers][fix] convert education fields to display string (#529)

This commit is contained in:
Zhang Ziqing
2022-11-07 23:26:36 +08:00
committed by GitHub
parent 7b044e11c3
commit 2293b6b8c4

View File

@@ -3,6 +3,8 @@ import {
LightBulbIcon,
} from '@heroicons/react/24/outline';
import type { EducationType } from '~/components/offers/EducationFields';
import { getLabelForEducationFieldType } from '~/components/offers/EducationFields';
import type { EducationDisplayData } from '~/components/offers/types';
type Props = Readonly<{
@@ -19,7 +21,16 @@ export default function EducationCard({
<div className="flex items-center">
<LightBulbIcon className="mr-1 h-5" />
<span className="text-semibold ml-1">
{field ? `${type ?? 'N/A'}, ${field}` : type ?? `N/A`}
{field
? `${
type ? type.charAt(0).toUpperCase() + type.slice(1) : 'N/A'
}, ${
getLabelForEducationFieldType(field as EducationType) ??
'N/A'
}`
: type
? type.charAt(0).toUpperCase() + type.slice(1)
: `N/A`}
</span>
</div>
{school && (