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

pull/531/head
Zhang Ziqing 2 years ago committed by GitHub
parent 7b044e11c3
commit 2293b6b8c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -3,6 +3,8 @@ import {
LightBulbIcon, LightBulbIcon,
} from '@heroicons/react/24/outline'; } 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'; import type { EducationDisplayData } from '~/components/offers/types';
type Props = Readonly<{ type Props = Readonly<{
@ -19,7 +21,16 @@ export default function EducationCard({
<div className="flex items-center"> <div className="flex items-center">
<LightBulbIcon className="mr-1 h-5" /> <LightBulbIcon className="mr-1 h-5" />
<span className="text-semibold ml-1"> <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> </span>
</div> </div>
{school && ( {school && (

Loading…
Cancel
Save