import { useRouter } from 'vue-router'
import { NDatePicker, NRadioButton, NRadioGroup, NButton } from 'naive-ui'
import GanttCom from '../Gantt'

export default defineComponent({
  setup() {
    const range = ref()
    const value = ref('day')

    const router = useRouter()
    const editEvent = () => {
      console.log(router)
      router.push('/gantt/mainEdit')
    }
    return () => (
      <>
        <div class="flex gap-2">
          <NDatePicker v-model:value={range.value} type="daterange" clearable />
          <NRadioGroup v-model:value={value.value} name="radiobuttongroup">
            <NRadioButton value="hour" label="日" />
            <NRadioButton value="day" label="月" />
          </NRadioGroup>
          <NButton class="ml-auto" type="primary" onClick={editEvent}>
            编辑事件
          </NButton>
        </div>
        <GanttCom scale={value.value} />
      </>
    )
  },
})
