diff --git a/app/components/GlobalFindBarDemo.tsx b/app/components/GlobalFindBarDemo.tsx new file mode 100644 index 0000000..3d14109 --- /dev/null +++ b/app/components/GlobalFindBarDemo.tsx @@ -0,0 +1,38 @@ +"use client"; + +import { useState } from "react"; +import { GlobalFindBar } from "@/registry/cell/GlobalFindBar"; + +export function GlobalFindBarDemo() { + const [query, setQuery] = useState(""); + const [currentMatch, setCurrentMatch] = useState(0); + + // Simulate finding matches + const matchCount = query.length > 0 ? Math.min(query.length * 2, 15) : 0; + + const handleNext = () => { + if (matchCount > 0) { + setCurrentMatch((prev) => (prev + 1) % matchCount); + } + }; + + const handlePrev = () => { + if (matchCount > 0) { + setCurrentMatch((prev) => (prev - 1 + matchCount) % matchCount); + } + }; + + return ( +
+ Choose your preferred runtime +
++ Choose your package manager +
+