mirror of
https://github.com/DevVoxel/VectorDNS.git
synced 2026-02-27 05:47:38 +00:00
Add landing page with shadcn/ui and dark mode
This commit is contained in:
37
components/domain-search-form.tsx
Normal file
37
components/domain-search-form.tsx
Normal file
@@ -0,0 +1,37 @@
|
||||
"use client";
|
||||
|
||||
import { useState, type FormEvent } from "react";
|
||||
import { useRouter } from "next/navigation";
|
||||
import { Search } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
|
||||
export function DomainSearchForm() {
|
||||
const [domain, setDomain] = useState("");
|
||||
const router = useRouter();
|
||||
|
||||
function handleSubmit(e: FormEvent) {
|
||||
e.preventDefault();
|
||||
const trimmed = domain.trim().toLowerCase();
|
||||
if (!trimmed) return;
|
||||
router.push(`/lookup/${encodeURIComponent(trimmed)}`);
|
||||
}
|
||||
|
||||
return (
|
||||
<form onSubmit={handleSubmit} className="flex w-full max-w-xl gap-2">
|
||||
<div className="relative flex-1">
|
||||
<Search className="absolute left-3 top-1/2 size-4 -translate-y-1/2 text-muted-foreground" />
|
||||
<Input
|
||||
type="text"
|
||||
value={domain}
|
||||
onChange={(e) => setDomain(e.target.value)}
|
||||
placeholder="Enter a domain name (e.g. google.com)"
|
||||
className="pl-9 h-11"
|
||||
/>
|
||||
</div>
|
||||
<Button type="submit" size="lg">
|
||||
Lookup
|
||||
</Button>
|
||||
</form>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user