"use client"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { z } from "zod"; import { Button } from "@/components/ui/button"; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage, } from "@/components/ui/form"; import { Input } from "@/components/ui/input"; import { setCustomization } from "@/lib/api"; import { useEffect } from "react"; import toast from "react-hot-toast"; import ColorProvider from "../ColorProvider"; const FormSchema = z.object({ website: z .string() .min(2, { message: "ID must be at least 2 characters.", }) .url({ message: "Image must be in URL form." }), }); export function BannerPopover({ server, get }: { server: string; get: any }) { const form = useForm>({ resolver: zodResolver(FormSchema), defaultValues: { website: "", }, }); async function onSubmit(data: z.infer) { toast.promise(setCustomization(server, { banner: data.website }), { loading: "Setting banner..", success: "Set banner!", error: "Error while setting banner", }); } return (
All images that are in a web supported format can be used as the banner for a server.

( Image URL )} />
); }