import { definitionListComponents } from '@/lib/keystatic/components/DefinitionList'
import { inlineComponents } from '@/lib/keystatic/components/Inline'
import { fields } from '@keystatic/core'

export const createContentField = (imageSubfolder: string) =>
  fields.markdoc({
    label: 'Content',
    options: {
      image: {
        directory: `public/images/content/${imageSubfolder}`,
        publicPath: `/images/content/${imageSubfolder}`,
      },
    },
    components: {
      ...definitionListComponents,
      ...inlineComponents,
    },
  })
