// import type { ComponentType } from '@unovis/ts'
import type { Component } from 'vue'

export interface ListItemDto {
  id: number
  name: string
  code: string
}

export type ComponentType = Component

export interface ButtonNav {
  variant?: 'default' | 'destructive' | 'outline' | 'secondary' | 'ghost' | 'link'
  classVal?: string
  classValExt?: string
  icon?: string
  label: string
  onClick?: () => void
}

export interface QuickSearchNav {
  inputClass?: string
  inputPlaceHolder?: string
  btnClass?: string
  btnIcon?: string
  btnLabel?: string
  mainField?: string
  searchParams: object
  onSubmit?: (searchParams: object) => void
}

export interface RefSearchNav {
  modelValue?: string
  placeholder?: string
  minLength?: number
  debounceMs?: number
  inputClass?: string
  showValidationFeedback?: boolean
  onInput: (val: string) => void
  onClick: () => void
  onClear: () => void
}

// prepared header for relatively common usage
export interface HeaderPrep {
  title?: string
  icon?: string
  refSearchNav?: RefSearchNav
  quickSearchNav?: QuickSearchNav
  filterNav?: ButtonNav
  addNav?: ButtonNav
  printNav?: ButtonNav
}

export interface KeyLabel {
  key: string
  label: string
}

export interface KeyNames {
  key: string
  label: string
}

export interface LinkItem {
  label: string
  icon?: string
  href?: string // to cover the needs of stating full external origins full url
  action?: string // for local paths
  onClick?: (event: Event) => void
  headerStatus?: boolean
}

export const ActionEvents = {
  showConfirmDelete: 'showConfirmDel',
  showEdit: 'showEdit',
  showDetail: 'showDetail',
  showProcess: 'showProcess',
}

export interface DataTableLoader {
  isTableLoading: boolean
  [key: string]: boolean
}
