import type { GlobalConfig } from 'payload'

export const Politik: GlobalConfig = {
    slug: 'politik',
    label: { de: 'Politik', en: 'Politics', hu: 'Politika' },
    admin: { group: 'Donauschwaben', },
    access: {
        read:   () => true,
        update: ({ req }) => ['admin', 'editor'].includes(req.user?.role ?? ''),
    },
    fields: [
        {
            name: 'titel',
            type: 'text',
            localized: true,
            label: { de: 'Titel', en: 'Title', hu: 'Cím' },
        },
        {
            name: 'einleitung',
            type: 'richText',
            localized: true,
            label: { de: 'Einleitung', en: 'Introduction', hu: 'Bevezetés' },
        },
    ],
}