Removed validation
This commit is contained in:
@@ -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())}`)
|
||||
|
||||
Reference in New Issue
Block a user