45 lines
859 B
TypeScript
45 lines
859 B
TypeScript
import type { Field } from '../../../packages/payload/src/fields/config/types'
|
|
|
|
export const hero: Field = {
|
|
name: 'hero',
|
|
label: false,
|
|
type: 'group',
|
|
fields: [
|
|
{
|
|
type: 'select',
|
|
name: 'type',
|
|
label: 'Type',
|
|
required: true,
|
|
defaultValue: 'lowImpact',
|
|
options: [
|
|
{
|
|
label: 'None',
|
|
value: 'none',
|
|
},
|
|
{
|
|
label: 'High Impact',
|
|
value: 'highImpact',
|
|
},
|
|
{
|
|
label: 'Low Impact',
|
|
value: 'lowImpact',
|
|
},
|
|
],
|
|
},
|
|
{
|
|
name: 'richText',
|
|
label: 'Rich Text',
|
|
type: 'richText',
|
|
},
|
|
{
|
|
name: 'media',
|
|
type: 'upload',
|
|
relationTo: 'media',
|
|
required: true,
|
|
admin: {
|
|
condition: (_, { type } = {}) => ['highImpact'].includes(type),
|
|
},
|
|
},
|
|
],
|
|
}
|