diff --git a/src/components/admin/AdminResource.tsx b/src/components/admin/AdminResource.tsx index e85f2f8..392d9ae 100644 --- a/src/components/admin/AdminResource.tsx +++ b/src/components/admin/AdminResource.tsx @@ -4,11 +4,12 @@ import { useCallback, useEffect, useState, type ReactNode } from "react"; import { FileUploadField } from "@/components/admin/FileUploadField"; import { AdminThumb } from "@/components/admin/AdminThumb"; +import { RichTextField } from "@/components/admin/RichTextField"; export interface FieldDef { key: string; label: string; - type?: "text" | "textarea" | "number" | "checkbox" | "select" | "image" | "file"; + type?: "text" | "textarea" | "richtext" | "number" | "checkbox" | "select" | "image" | "file"; options?: { value: string; label: string }[]; required?: boolean; placeholder?: string; @@ -193,21 +194,26 @@ export function AdminResource({ config }: { config: ResourceConfig }) { {(creating || editing) && config.fields && ( -
-
e.stopPropagation()}> -

- {editing ? "ویرایش" : "افزودن"} — {config.title} -

-
+
+
e.stopPropagation()}> +
+

+ {editing ? "ویرایش" : "افزودن"} — {config.title} +

+ +
+
{config.fields.map((f) => ( -
+
{f.type !== "checkbox" && ( )} - {f.type === "textarea" ? ( -