hata düzeltme 2
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client"
|
||||
|
||||
import { useState } from "react"
|
||||
import { useForm } from "react-hook-form"
|
||||
import { useForm, type Resolver } from "react-hook-form"
|
||||
import { zodResolver } from "@hookform/resolvers/zod"
|
||||
import * as z from "zod"
|
||||
import { Button } from "@/components/ui/button"
|
||||
@@ -59,7 +59,7 @@ export function ProductForm({ initialData }: ProductFormProps) {
|
||||
const [loading, setLoading] = useState(false)
|
||||
|
||||
const form = useForm<ProductFormValues>({
|
||||
resolver: zodResolver(productSchema) as any,
|
||||
resolver: zodResolver(productSchema) as Resolver<ProductFormValues>,
|
||||
defaultValues: initialData ? {
|
||||
name: initialData.name,
|
||||
category: initialData.category,
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
"use client"
|
||||
|
||||
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs"
|
||||
import { SiteSettingsForm } from "@/components/dashboard/site-settings-form"
|
||||
import { SiteSettingsForm, SettingsFormValues } from "@/components/dashboard/site-settings-form"
|
||||
import { SmsSettingsForm } from "@/components/dashboard/sms-settings-form"
|
||||
import { AppearanceForm } from "@/components/dashboard/appearance-form"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { Button } from "@/components/ui/button"
|
||||
|
||||
interface SettingsTabsProps {
|
||||
siteSettings: Record<string, any> | null
|
||||
siteSettings: Partial<SettingsFormValues> | null
|
||||
smsSettings: {
|
||||
username: string
|
||||
header: string
|
||||
|
||||
@@ -30,10 +30,10 @@ const settingsSchema = z.object({
|
||||
currency: z.string(),
|
||||
})
|
||||
|
||||
type SettingsFormValues = z.infer<typeof settingsSchema>
|
||||
export type SettingsFormValues = z.infer<typeof settingsSchema>
|
||||
|
||||
interface SiteSettingsFormProps {
|
||||
initialData: any
|
||||
initialData: Partial<SettingsFormValues> | null
|
||||
}
|
||||
|
||||
export function SiteSettingsForm({ initialData }: SiteSettingsFormProps) {
|
||||
|
||||
@@ -15,9 +15,9 @@ import {
|
||||
FormLabel,
|
||||
FormMessage,
|
||||
} from "@/components/ui/form"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle, CardFooter } from "@/components/ui/card"
|
||||
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
|
||||
import { toast } from "sonner"
|
||||
import { Loader2, Smartphone, Send } from "lucide-react"
|
||||
import { Loader2, Send } from "lucide-react"
|
||||
import { updateSmsSettings, sendTestSms } from "@/lib/sms/actions"
|
||||
|
||||
const smsSettingsSchema = z.object({
|
||||
|
||||
Reference in New Issue
Block a user