"use client"; import axios from "axios" import { Button } from "@/components/ui/button"; import { Dialog, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, DialogTrigger } from "@/components/ui/dialog"; import { Input } from "@/components/ui/input"; import * as z from "zod"; import { zodResolver } from "@hookform/resolvers/zod"; import { useForm } from "react-hook-form"; import { Form, FormControl, FormField, FormItem, FormLabel, FormMessage } from "@/components/ui/form"; import { useEffect, useState } from "react"; import { useRouter } from "next/navigation"; import { Info } from "lucide-react"; import { Toggle } from "../ui/toggle"; import { TtsBadgeFilter, TwitchConnection } from "@prisma/client"; const formSchema = z.object({ whitelist: z.string().trim().array(), blacklist: z.string().trim().array() }); export const TTSBadgeFilterModal = () => { const [isMounted, setIsMounted] = useState(false); useEffect(() => { setIsMounted(true); }, []); const router = useRouter(); const form = useForm({ resolver: zodResolver(formSchema), defaultValues: { whitelist: z.string().trim().array(), blacklist: z.string().trim().array() } }); const isLoading = form.formState.isSubmitting; const onSubmit = async (values: z.infer) => { let response = null; // try { // response = await axios.post("/api/settings/tts/filter/badges", values); // } catch (error) { // console.log("[CONNECTIONS/TWITCH/POST]", error); // return; // } form.reset(); router.refresh(); window.location.reload(); } if (!isMounted) { return null; } const badges: TtsBadgeFilter[] = [] //(await axios.get("/api/settings/tts/filter/badges")).data return ( TTS Badge Filter Limit messages spoken by TTS by badges.
{badges.map((badge) => (
{ return ( {badge.badgeId} ) }} />
))}
); }