Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions components/SnippetForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import React, { SetStateAction } from "react";
import { SnippetFormValues } from "@/types/type";
import { zodResolver } from "@hookform/resolvers/zod";
import { snippetSchema } from "@/validiation/snippet-form-validiation";
import { toast } from "sonner";

interface SnippetFormProps {
editingId: string | null;
Expand Down Expand Up @@ -53,6 +54,14 @@ export default function SnippetForm({
} = form;

const onSubmit = async (data: SnippetFormValues) => {
// Mock isConnected state - replace with real state later
const isConnected = false;

if (!isConnected) {
toast.error("Please connect your wallet before submitting.");
return;
}

try {
setSubmitting(true);
const payload = {
Expand Down