'use client'

import { MediaField } from '@admin/components/custom/media-field'

export interface ContentEditorMediaGalleryBlockProps {
  accept?: string
  disabled?: boolean
  onMediaSelected: (url: string) => void
  onRemove: () => void
}

export function ContentEditorMediaGalleryBlock({
  accept = 'image/*',
  disabled = false,
  onMediaSelected,
  onRemove
}: ContentEditorMediaGalleryBlockProps) {
  return (
    <MediaField
      value=""
      onChange={(url) => {
        if (url) onMediaSelected(url)
      }}
      onRemove={onRemove}
      disabled={disabled}
      accept={accept}
      isRemovable
      valueMode="url"
    />
  )
}
