<script setup lang="ts">
const refSearchNav = {
  onClick: () => {
    // open filter modal
  },
  onInput: (_val: string) => {
    // filter patient list
  },
  onClear: () => {
    // clear url param
  },
}

const hreaderPrep: HeaderPrep = {
  title: 'Pasien',
  icon: 'bi bi-journal-check',
  addNav: {
    label: 'Tambah',
    onClick: () => navigateTo('/patient/add'),
  },
}

// NOTE: example api
async function getPatientList() {
  const { data } = await xfetch('/api/v1/patient')
  console.log('data patient', data)
}

onMounted(() => {
  getPatientList()
})
</script>

<template>
  <PubNavHeaderPrep :prep="{ ...hreaderPrep }" :ref-search-nav="refSearchNav" icon="i-lucide-add" />
</template>
