Skip to content

Commit

Permalink
add text error for "voting protection" input in PoolForm
Browse files Browse the repository at this point in the history
  • Loading branch information
Mati0x committed Dec 17, 2024
1 parent b5501eb commit 90dbedd
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions apps/web/components/Forms/FormSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,10 @@ export function FormSelect({
tooltip,
readOnly,
disabled,
errors,
}: Props) {
const hasError = errors?.[registerKey];

return (
<div className="flex flex-col">
<label htmlFor={registerKey} className="label w-fit cursor-pointer">
Expand Down Expand Up @@ -69,6 +72,11 @@ export function FormSelect({
</option>
))}
</select>
{hasError && (
<span className="text-danger-content text-sm mt-2">
{hasError.message || "This field is required"}
</span>
)}
</div>
);
}

0 comments on commit 90dbedd

Please sign in to comment.