import type { ComponentSchema } from '@keystatic/core'
import { fields } from '@keystatic/core'
export const createSeoField = (): ComponentSchema =>
  fields.object(
    {
      metaTitle: fields.text({
        label: 'Meta Title',
        validation: { length: { max: 60 } },
      }),
      metaDescription: fields.text({
        label: 'Meta Description',
        multiline: true,
        validation: { length: { max: 160 } },
      }),
      keywords: fields.array(fields.text({ label: 'Keyword' }), {
        label: 'SEO Keywords',
      }),
      noIndex: fields.checkbox({
        label: 'No Index',
        description: 'Prevent search engines from indexing',
      }),
    },
    {
      label: 'SEO Settings',
    }
  )
