import type { App } from 'vue'
import PrimeVue from 'primevue/config'
import Aura from '@primevue/themes/aura'
import type { UiProvider } from '../../provider/UiProvider'
import { installUiAdapter } from '../useUiAdapter'
import { primeVueUiAdapter } from './index'
import './adapter.css'

export const primeVueUiProvider: UiProvider = {
  id: 'primevue-aggrid',
  install(app: App): void {
    app.use(PrimeVue, {
      theme: {
        preset: Aura,
        options: { darkModeSelector: false }
      }
    })
    installUiAdapter(app, primeVueUiAdapter)
  }
}

export function installPrimeVueAdapter(app: App): void {
  primeVueUiProvider.install(app)
}
