import { defineField, defineType } from "sanity"; import { Settings } from "lucide-react"; export default defineType({ name: "settings", title: "Settings", type: "document", icon: Settings, fields: [ defineField({ name: "logo", type: "object", fields: [ defineField({ name: "dark", type: "image", options: { hotspot: true }, }), defineField({ name: "light", type: "image", options: { hotspot: true }, }), defineField({ name: "width", type: "number", title: "Width", description: "The width of the logo. Default is dimensions of the image.", }), defineField({ name: "height", type: "number", title: "Height", description: "The height of the logo. Default is dimensions of the image.", }), ], }), defineField({ name: "siteName", type: "string", description: "The name of your site", initialValue: "Vietnam Wedding Guide", validation: (Rule) => Rule.required().error("Site name is required"), }), defineField({ name: "tagline", type: "string", title: "Tagline", description: "Short subtitle or editorial motto", initialValue: "Bespoke Destination Weddings & Editorial Guides", }), defineField({ name: "footerText", type: "text", rows: 3, title: "Footer Text", description: "Editorial statement or description displayed in the footer", initialValue: "The premier editorial resource and advisory for bespoke destination weddings across Vietnam.", }), defineField({ name: "contactEmail", type: "string", title: "Contact Email", initialValue: "info@weddinginvietnam.com", }), defineField({ name: "whatsapp", type: "string", title: "WhatsApp Number / Link", description: "Phone number with country code, e.g. +84908372168", initialValue: "+84908372168", }), defineField({ name: "socialLinks", type: "array", title: "Social Media Links", of: [ { type: "object", fields: [ defineField({ name: "platform", type: "string", title: "Platform", options: { list: [ { title: "Instagram", value: "instagram" }, { title: "Facebook", value: "facebook" }, { title: "Pinterest", value: "pinterest" }, { title: "LinkedIn", value: "linkedin" }, { title: "WhatsApp", value: "whatsapp" }, ], }, }), defineField({ name: "url", type: "url", title: "Profile URL", }), ], preview: { select: { title: "platform", subtitle: "url", }, }, }, ], }), defineField({ name: "copyright", type: "block-content", description: "The copyright text to display in the footer", }), ], preview: { select: { title: "siteName", media: "logo", }, prepare({ title, media }) { return { title: title || "Site Settings", media, }; }, }, });