import type { ChatPageContext } from '../../context'
import { h } from 'vue'
import { DimSdkCommandPalette } from '../../../../ui/components/CommandPalette'

export function renderSkillsOverlay(ctx: ChatPageContext) {
  return [
    h(DimSdkCommandPalette, {
      modelValue: ctx.showSkills.value,
      'onUpdate:modelValue': (v: boolean) => (ctx.showSkills.value = v),
      title: 'Skills',
      options: ctx.skillsOptions.value,
      selectedIndex: ctx.skillsIndex.value,
      'onUpdate:selectedIndex': (v: number) => (ctx.skillsIndex.value = v),
      onSelect: (v: string | null) => ctx.onSkillSelect(v),
      onClose: ctx.closeSkills,
    }),
  ]
}
