"use client"; import { ArrowRight, Search } from "lucide-react"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { openPalette } from "@/components/command-palette"; import { Kbd } from "@/components/ui/kbd"; import { routes } from "@/lib/routes"; const SUGGESTIONS = ["Northern Virginia", "hyperscale in Ireland", "> 100 MW under construction", "Equinix", "Japan"]; export function HeroSearch() { const router = useRouter(); const [q, setQ] = useState(""); return (
{ e.preventDefault(); if (q.trim()) router.push(routes.search(q.trim())); else openPalette(); }} className="flex h-12 items-center rounded-sm border border-hair-2 bg-surface focus-within:border-ink sm:h-14" > setQ(e.target.value)} onFocus={(e) => { if (window.matchMedia("(min-width: 640px)").matches) { e.currentTarget.blur(); openPalette(); } }} placeholder="Search a data center, operator, market or country…" aria-label="Search the index" className="h-full min-w-0 flex-1 bg-transparent px-3 text-[15px] outline-none placeholder:text-ink-4 sm:text-[16px]" autoComplete="off" enterKeyHint="search" /> ⌘ K
Try {SUGGESTIONS.map((s) => ( ))}
); }