Removed validation

This commit is contained in:
2025-08-30 14:38:00 +02:00
parent 9dfc20ca07
commit c9e83d0980
3 changed files with 36 additions and 33 deletions

View File

@@ -1,12 +1,10 @@
"use client"
import { Input } from "@/components/ui/input"
import { validatePlayer } from "@/lib/hypixel/actions"
import { cn } from "@/lib/utils"
import { Search } from "lucide-react"
import { useRouter } from "next/navigation"
import { useState } from "react"
import { toast } from "sonner"
export function SearchBar({ navbar }: { navbar?: boolean }) {
const [input, setInput] = useState("")
@@ -15,13 +13,13 @@ export function SearchBar({ navbar }: { navbar?: boolean }) {
async function handleSearch(e: React.FormEvent) {
e.preventDefault()
const validatedPlayer = await validatePlayer(input.trim())
if (validatedPlayer.error === true) {
toast.error(validatedPlayer.message)
setInput("")
return
}
// const validatedPlayer = await validatePlayer(input.trim())
//
// if (validatedPlayer.error === true) {
// toast.error(validatedPlayer.message)
// setInput("")
// return
// }
if (input.trim()) {
router.push(`/player/${encodeURIComponent(input.trim())}`)