import { useState } from 'react'; import axios from 'axios'; import { Target, BarChart3 } from 'lucide-react'; import { motion } from 'framer-motion'; import { PageHeader, ResultBox, ErrorBox, SubmitButton, SectionLabel } from '../components/UI'; export default function ZeroShotLab() { const [text, setText] = useState(''); const [labels, setLabels] = useState(''); const [result, setResult] = useState(null); const [error, setError] = useState(''); const [loading, setLoading] = useState(false); const handleSubmit = async (e) => { e.preventDefault(); if (!text.trim() || !labels.trim()) return; setLoading(true); setError(''); setResult(null); try { const res = await axios.post('/api/zsl', { text, labels }); setResult(res.data); } catch (err) { setError(err.response?.data?.error || 'Request failed'); } finally { setLoading(false); } }; const barColors = [ 'from-cyan-500 to-blue-500', 'from-purple-500 to-pink-500', 'from-emerald-500 to-teal-500', 'from-amber-500 to-orange-500', 'from-red-500 to-rose-500', ]; return (