import React from 'react'
import ReactDOM from 'react-dom/client'
import './index.css'
import App from './App'
import { AppProvider } from '@shopify/polaris'
import enTranslations from '@shopify/polaris/locales/en.json'
import '@shopify/polaris/build/esm/styles.css'
import { Link } from 'react-router-dom'

const root = ReactDOM.createRoot(document.getElementById('root'))
const CustomLinkComponent = ({ children, url, ...rest }) => {
  return (
    <Link to={url} {...rest}>
      {children}
    </Link>
  )
}

root.render(
  <React.StrictMode>
    <AppProvider linkComponent={CustomLinkComponent} i18n={enTranslations}>
      <App />
    </AppProvider>
  </React.StrictMode>
)
