Skip to content

Commit

Permalink
fixed type
Browse files Browse the repository at this point in the history
  • Loading branch information
SkidGod4444 committed Oct 29, 2024
1 parent 41af28d commit 488bc0d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Binary file modified www/bun.lockb
Binary file not shown.
20 changes: 11 additions & 9 deletions www/components/custom/try-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ import {
} from "@/components/ui/tooltip";
import { toast } from "sonner";

type FormData = {
name: string;
framework: string;
desc: string;
};

export default function TryCard() {
const [heat, setHeat] = useState(0.8);
const [excluded, setExclude] = useState<string[] | undefined>(["name"]);
Expand All @@ -39,14 +45,10 @@ export default function TryCard() {
register,
handleSubmit,
formState: { errors },
} = useForm({
} = useForm<FormData>({
resolver: ProfanityResolver(profanityInit),
});
const onSubmit = async (data: {
name: string;
framework: string;
desc: string;
}) => {
const onSubmit = async (data: { name: string; framework: string; desc: string }) => {
toast(
`Name: ${data.name}, Framework: ${data.framework}, Desc: ${data.desc}`,
);
Expand Down Expand Up @@ -186,7 +188,7 @@ export default function TryCard() {
/>
{errors.name && (
<div className="text-red-500 text-sm">
{errors.name.message}
{String(errors.name.message)}
</div>
)}
</div>
Expand All @@ -201,7 +203,7 @@ export default function TryCard() {
/>
{errors.framework && (
<div className="text-red-500 text-sm">
{errors.framework.message}
{String(errors.framework.message)}
</div>
)}
</div>
Expand All @@ -217,7 +219,7 @@ export default function TryCard() {
/>
{errors.desc && (
<div className="text-red-500 text-sm">
{errors.desc.message}
{String(errors.desc.message)}
</div>
)}
</div>
Expand Down

0 comments on commit 488bc0d

Please sign in to comment.