diff --git a/src/app/(tools)/(domain)/whois/[domain]/page.tsx b/src/app/(tools)/(domain)/whois/[domain]/page.tsx index 4751fa1..f3da198 100644 --- a/src/app/(tools)/(domain)/whois/[domain]/page.tsx +++ b/src/app/(tools)/(domain)/whois/[domain]/page.tsx @@ -98,7 +98,7 @@ export default async function WhoisLookupResultPage({ ); } - return {contact.email}; + return {contact.email}; } }); @@ -132,22 +132,25 @@ export default async function WhoisLookupResultPage({ ), Status: () => (
- {result.domain.status.map((status) => ( - - { + const status = + EPP_STATUS_CODES.find((c) => s === c.toLowerCase()) ?? s; + return ( + - {EPP_STATUS_CODES.find((c) => status === c.toLowerCase()) ?? - status} - - - ))} + + {status} + + + ); + })}
), Nameservers: () => ( diff --git a/src/app/(tools)/ip/[ip]/page.tsx b/src/app/(tools)/ip/[ip]/page.tsx index cbf0611..904e671 100644 --- a/src/app/(tools)/ip/[ip]/page.tsx +++ b/src/app/(tools)/ip/[ip]/page.tsx @@ -15,7 +15,7 @@ import { import { Table, TableBody, TableCell, TableRow } from '@/components/ui/table'; import { CACHE_REVALIDATE_SECONDS } from '@/lib/config'; import { TOOLS } from '@/lib/resources/tools'; -import { cn } from '@/lib/utils'; +import { capitalize, cn } from '@/lib/utils'; import { api } from '@/trpc/server'; import type { InfoTable } from '@/types'; import { IPLookupForm } from '../form'; @@ -53,14 +53,19 @@ export default async function IPLookupResultPage({ } const properties = Object.entries(result.properties).map(([key, value]) => ({ - label: key === 'vpn' ? 'VPN' : key.charAt(0).toUpperCase() + key.slice(1), + label: key === 'vpn' ? 'VPN' : capitalize(key), value })); const table = { name: 'IP Address Information', keys: { - Hostname: () => result.hostname, + Hostname: () => + result.hostname && ( + + {result.hostname} + + ), 'Time Zone': () => result.location.timezone, Location: () => result.location.city + @@ -94,7 +99,7 @@ export default async function IPLookupResultPage({

Type:{' '} - {result.asn.type.toUpperCase()} + {capitalize(result.asn.type)}

ASN: {result.asn.asn.slice(2)} @@ -125,7 +130,7 @@ export default async function IPLookupResultPage({

Type:{' '} - {result.company.type.toUpperCase()} + {capitalize(result.company.type)}

diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 39709ab..62e2860 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -6,6 +6,10 @@ export function cn(...inputs: ClassValue[]) { return twMerge(clsx(inputs)); } +export function capitalize(str: string) { + return str.charAt(0).toUpperCase() + str.slice(1); +} + export function parseDomain(hostname: string) { const result = _parseDomain(decodeURIComponent(hostname)); return result.type === ParseResultType.Listed