import { defineField, defineType } from "sanity"; import { orderRankField } from "@sanity/orderable-document-list"; export default defineType({ name: "testimonial", title: "Testimonial", type: "document", description: "Client and couple testimonials. Used in the carousel-2 page builder block and available for standalone social proof components.", fields: [ defineField({ name: "name", title: "Client / Couple Name", type: "string", validation: (Rule) => Rule.required(), }), defineField({ name: "title", title: "Subtitle / Celebration Context", description: "e.g. 'Destination Wedding Couple — InterContinental Da Nang, 2024'", type: "string", }), defineField({ name: "image", type: "image", }), defineField({ name: "body", type: "block-content", }), defineField({ name: "rating", type: "number", validation: (rule) => rule.min(1).max(5), }), orderRankField({ type: "testimonial" }), ], preview: { select: { title: "name", media: "image", }, }, });