// src/components/validators/ModelValidator.tsx import { useEffect } from 'react'; import { Loader, CheckCircle, XCircle, ExternalLink } from 'lucide-react'; import { useHFModelValidator } from '../../hooks/useHFValidators'; export default function ModelValidator({ modelId, type, }: { modelId: string; type: 'language' | 'scorer'; }) { const { loading, result, validate } = useHFModelValidator(); useEffect(() => { validate(modelId, type); }, [modelId, type, validate]); if (!modelId?.includes('/')) return null; return (
{loading && (
Validating Model...
)} {!!result && !loading && (
{result.isValid ? ( ) : ( )}
{result.isValid ? ( <>

✅ Model Verification Sucessful

Author: {result.modelInfo.author}

Download: {result.modelInfo.downloads.toLocaleString()}

{!!result.modelInfo.pipeline_tag && (

Task: {result.modelInfo.pipeline_tag}

)}
View on Hugging Face ) : ( <>

❌ Model Verification Failed

{result.error}

)}
)}
); }