feat: add domain role translate

This commit is contained in:
Maël Gangloff
2024-07-28 21:35:38 +02:00
parent c3fe822f41
commit c78843a3d2
2 changed files with 79 additions and 20 deletions

View File

@@ -40,6 +40,21 @@ type FieldType = {
ldhName: string
}
const domainRole = {
registrant: () => t`Registrant`,
technical: () => t`Technical`,
administrative: () => t`Administrative`,
abuse: () => t`Abuse`,
billing: () => t`Billing`,
registrar: () => t`Registrar`,
reseller: () => t`Reseller`,
sponsor: () => t`Sponsor`,
proxy: () => t`Proxy`,
notifications: () => t`Notifications`,
noc: () => t`Noc`
}
export default function DomainSearchPage() {
const [domain, setDomain] = useState<Domain | null>()
@@ -178,7 +193,7 @@ export default function DomainSearchPage() {
title={e.entity.handle}
description={name}
/>
<div>{e.roles.join(', ')}</div>
<div>{e.roles.map((r) => Object.keys(domainRole).includes(r) ? domainRole[r as keyof typeof domainRole]() : r).join(', ')}</div>
</List.Item>
}}
/>