Views
No views yet
const regex = /^[a-zA-Z0-9_-]+\/[a-zA-Z0-9_-]+$/;
if (!regex.test(repoId)) {
toast.error("Invalid repository format. The submission must be a valid Hugging Face repository ID in the format username/repo-name.");
return;
}
const newSubmissions = [...submissions, repoId];
setSubmissions(newSubmissions);
setAttempts(attempts + 1);
toast.success("Repository submitted successfully!"); {submissions.length > 0 && (
<div className="mt-6 w-full max-w-md">
<h3 className="text-lg font-bold">Submission History</h3>
<ul className="mt-2 border p-3 rounded-lg">
{submissions.map((repo, index) => (
<li key={index} className="text-sm border-b py-1">
{repo}
</li>
))}
</ul>
</div>
)}
</div>