import React from 'react'
import { createRoot } from 'react-dom/client'
import SimilarArtworksHeader from './Pages/Artwork/SimilarArtworksHeader'

const mountEl = document.getElementById('similar-artworks-header-root')

if (mountEl) {
  let props = {}

  try {
    const propsEl = document.getElementById('similar-artworks-header-props')
    props = propsEl ? JSON.parse(propsEl.textContent || '{}') : {}
  } catch {
    props = {}
  }

  createRoot(mountEl).render(<SimilarArtworksHeader {...props} />)
}