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