mirror of
https://github.com/Xevion/rdap.git
synced 2025-12-06 09:16:05 -06:00
Use placeholders constants with SimplifiedTargetType
This commit is contained in:
@@ -12,6 +12,7 @@ import {
|
||||
import { Listbox, Transition } from "@headlessui/react";
|
||||
import clsx from "clsx";
|
||||
import type { Maybe } from "true-myth";
|
||||
import { placeholders } from "@/constants";
|
||||
|
||||
/**
|
||||
* Props for the LookupInput component.
|
||||
@@ -136,7 +137,7 @@ const LookupInput: FunctionComponent<LookupInputProps> = ({
|
||||
" focus:outline-none sm:text-sm md:py-3 md:text-base lg:text-lg"
|
||||
)}
|
||||
disabled={isLoading}
|
||||
placeholder="A domain, an IP address, a TLD, an RDAP URL..."
|
||||
placeholder={placeholders[selected]}
|
||||
type="search"
|
||||
{...register("target", {
|
||||
required: true,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// see https://www.iana.org/assignments/rdap-json-values
|
||||
import type { RdapStatusType, RootRegistryType, TargetType } from "@/types";
|
||||
import type { RdapStatusType, RootRegistryType, SimplifiedTargetType, TargetType } from "@/types";
|
||||
|
||||
export const rdapStatusInfo: Record<RdapStatusType, string> = {
|
||||
validated:
|
||||
@@ -79,9 +79,9 @@ export const registryURLs: Record<RootRegistryType, string> = {
|
||||
entity: "https://data.iana.org/rdap/object-tags.json",
|
||||
};
|
||||
|
||||
export const placeholders: Record<TargetType, string> = {
|
||||
ip4: "192.168.0.1/16",
|
||||
ip6: "TODO: Complete this placeholder",
|
||||
export const placeholders: Record<SimplifiedTargetType | "auto", string> = {
|
||||
auto: "A domain, an IP address, a TLD, an RDAP URL...",
|
||||
ip: "192.168.0.1/16 or 2001:db8::/32",
|
||||
autnum: "65535",
|
||||
entity: "ABC123-EXAMPLE",
|
||||
url: "https://rdap.org/domain/example.com",
|
||||
|
||||
Reference in New Issue
Block a user