import type { GlobalConfig } from 'payload'
import { adminOrEditor, anyRole } from '@/access/roles'
import { logGlobalChange } from '@/hooks/auditLog'
import { footerFields } from './fields'

export const Footer: GlobalConfig = {
  slug: 'footer',
  label: 'Footer',
  access: {
    read: anyRole,
    update: adminOrEditor,
  },
  fields: footerFields,
  hooks: {
    afterChange: [logGlobalChange('footer')],
  },
}
