import type { CollectionConfig } from 'payload' import { ADMIN_GROUP } from '../admin/groups' export const Specialties: CollectionConfig = { slug: 'specialties', labels: { singular: 'Направление', plural: 'Направления' }, admin: { group: ADMIN_GROUP.catalog, useAsTitle: 'title' }, access: { read: () => true }, fields: [ { name: 'title', type: 'text', required: true, localized: true }, { name: 'slug', type: 'text', required: true, unique: true }, { name: 'description', type: 'textarea', localized: true }, { name: 'icon', type: 'text', label: 'Иконка', admin: { description: 'Встроенная иконка (Untitled UI). Если ниже загружена своя картинка, используется она.', components: { Field: '/components/admin/IconPicker#IconPicker' }, }, }, { name: 'iconImage', type: 'upload', relationTo: 'media', label: 'Своя иконка (SVG или PNG)', filterOptions: { mimeType: { contains: 'image' } }, }, { name: 'sortOrder', type: 'number', defaultValue: 0 }, ], }