"use client"; import { useRouter } from "next/navigation"; import { useState } from "react"; import { Button } from "../ui/button"; import { Input } from "../ui/input"; export function LookupPlayer() { const router = useRouter(); const [player, setPlayer] = useState(""); /** * Set the player value * * @param event the input event */ const setPlayerValue = (event: React.ChangeEvent) => { setPlayer(event.target.value); }; /** * Lookup a player */ const lookupPlayer = () => { if (!player || player.length === 0) { return; } router.push(`/player/${player}`); }; return (
); }