import { defineField, defineType } from "sanity"; import { Info } from "lucide-react"; export default defineType({ name: "callout", title: "Callout Box", type: "object", icon: Info, fields: [ defineField({ name: "tone", title: "Tone", type: "string", options: { list: [ { title: "Gold Luxury (Default)", value: "gold" }, { title: "Neutral / Minimal", value: "neutral" }, { title: "Editorial Highlight", value: "highlight" }, ], layout: "radio", }, initialValue: "gold", }), defineField({ name: "title", title: "Title / Badge", type: "string", description: "Optional heading for the callout, e.g., 'Key Takeaway' or 'Insider Tip'", }), defineField({ name: "content", title: "Content", type: "text", rows: 4, validation: (Rule) => Rule.required().error("Callout content is required"), }), ], preview: { select: { title: "title", content: "content", tone: "tone", }, prepare({ title, content, tone }) { return { title: title || content?.slice(0, 40) || "Callout Box", subtitle: `Tone: ${tone || "gold"}`, }; }, }, });