Skip to content

Commit

Permalink
chore: use tag map
Browse files Browse the repository at this point in the history
  • Loading branch information
thorkellmani committed Aug 12, 2024
1 parent 3c53d29 commit 8b50893
Showing 1 changed file with 7 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,15 @@ import { UserInfoLine } from '@island.is/service-portal/core'
import { useState } from 'react'
import ExpandableLine from '../ExpandableLine/ExpandableLine'

const getTagColor = (
color: GenericUserLicenseDataFieldTagColor,
): 'red600' | 'yellow600' | 'mint600' | undefined => {
switch (color) {
case 'red':
return 'red600'
case 'yellow':
return 'yellow600'
case 'green':
return 'mint600'
default:
return
}
const tagColorMap: Record<GenericUserLicenseDataFieldTagColor, string> = {
red: 'red600',
yellow: 'yellow600',
green: 'mint600',
}

const getTagColor = (color: GenericUserLicenseDataFieldTagColor) =>
tagColorMap[color]

export const LicenseDataFields = ({
fields,
licenseType,
Expand Down

0 comments on commit 8b50893

Please sign in to comment.