diff --git a/ui/app/actions.ts b/ui/app/actions.ts index 97eb498..d734d87 100644 --- a/ui/app/actions.ts +++ b/ui/app/actions.ts @@ -72,3 +72,16 @@ export async function getDomains({ ); return await res.json(); } + +export async function checkReservedName(domainName: string) { + const res = await fetch( + `${process.env.NEXT_PUBLIC_API_URL}/domains/${domainName}/reserved`, + { + headers: { + "Content-Type": "application/json", + "x-api-key": process.env.NEXT_PUBLIC_X_API_KEY, + }, + } + ); + return await res.json(); +} diff --git a/ui/components/atoms/resultItem/resultItem.tsx b/ui/components/atoms/resultItem/resultItem.tsx index 715be8a..d472442 100644 --- a/ui/components/atoms/resultItem/resultItem.tsx +++ b/ui/components/atoms/resultItem/resultItem.tsx @@ -3,11 +3,20 @@ import { Button } from "../button"; import { Variant } from "../button/types"; import style from "./index.module.css"; -const ResultItem = ({ text, className }) => { +const ResultItem = ({ + statusName, + className, +}: { + statusName: { + isReserved: boolean; + name: string; + }; + className: string; +}) => { return (
- {text} + {statusName.name} .mina