mirror of
https://github.com/Xevion/rdap.git
synced 2026-01-31 20:25:16 -06:00
Move all components into /components/ subfolders
- Fixed last remaining axios to fetch switch
This commit is contained in:
+4
-2
@@ -1,10 +1,11 @@
|
||||
import {type NextPage} from "next";
|
||||
import Head from "next/head";
|
||||
import {useRef, useState} from "react";
|
||||
import Generic, {type ParsedGeneric} from "@/components/Generic";
|
||||
import {useState} from "react";
|
||||
import Generic, {type ParsedGeneric} from "@/components/lookup/Generic";
|
||||
import useLookup from "@/hooks/useLookup";
|
||||
import {onPromise} from "@/helpers";
|
||||
import {OGP} from "react-ogp";
|
||||
import LookupInput from "@/components/form/LookupInput";
|
||||
|
||||
const Index: NextPage = () => {
|
||||
const {error, setTarget, submit, currentType} = useLookup();
|
||||
@@ -61,6 +62,7 @@ const Index: NextPage = () => {
|
||||
</span>
|
||||
</nav>
|
||||
<div className="container py-12 mx-auto max-w-screen-lg">
|
||||
<LookupInput />
|
||||
<form onSubmit={onPromise(async function (e) {
|
||||
e.preventDefault()
|
||||
|
||||
|
||||
+2
-3
@@ -6,8 +6,7 @@ import {domainMatch, getBestURL, getType} from "@/rdap";
|
||||
import type {FormEvent} from "react";
|
||||
import {useEffect, useMemo, useState} from "react";
|
||||
import {truthy} from "@/helpers";
|
||||
import type {ParsedGeneric} from "@/components/Generic";
|
||||
import Generic from "@/components/Generic";
|
||||
import Generic, {type ParsedGeneric} from "@/components/lookup/Generic";
|
||||
import type {ZodSchema} from "zod";
|
||||
import {DomainSchema, RegisterSchema} from "@/schema";
|
||||
|
||||
@@ -144,7 +143,7 @@ const Old: NextPage = () => {
|
||||
setError('This object does not exist.');
|
||||
else if (response.status != 200)
|
||||
setError(`Error ${response.status}: ${response.statusText}`)
|
||||
data = schema.parse(response.data);
|
||||
data = schema.parse(await response.json());
|
||||
} catch (e) {
|
||||
console.log(e);
|
||||
setLoading(false);
|
||||
|
||||
Reference in New Issue
Block a user