mirror of
https://github.com/vercel/commerce.git
synced 2025-05-15 14:06:59 +00:00
31 lines
544 B
TypeScript
31 lines
544 B
TypeScript
import {CopyIcon} from '@sanity/icons'
|
|
import {defineField, defineType} from 'sanity'
|
|
|
|
export default defineType({
|
|
name: 'productVariant',
|
|
title: 'Product variant',
|
|
type: 'document',
|
|
icon: CopyIcon,
|
|
fields: [
|
|
// Title
|
|
defineField({
|
|
title: 'Title',
|
|
name: 'title',
|
|
type: 'string',
|
|
description: 'Product variant title/name.'
|
|
}),
|
|
],
|
|
preview: {
|
|
select: {
|
|
title: 'title',
|
|
},
|
|
prepare(selection) {
|
|
const {title} = selection
|
|
|
|
return {
|
|
title,
|
|
}
|
|
},
|
|
},
|
|
})
|