<script setup lang="ts">
import type { PrescriptionItem } from '~/models/prescription-item';
import { config } from './list-entry.cfg'

defineProps<{
  data: PrescriptionItem[]
}>()

const emit = defineEmits<{
  add: [mode: 'mix' | 'non-mix']
}>()

</script>

<template>
  <PubMyUiDataTable class="border mb-3 2xl:mb-4"
    v-bind="config"
    :rows="data"
  />
  <div class="-mx-1 [&_button]:mx-1">
    <Button @click="emit('add', 'mix')">
      <Icon name="i-lucide-plus" />
      Tambah Racikan
    </Button>
    <Button @click="emit('add', 'non-mix')">
      <Icon name="i-lucide-plus" />
      Tambah Non Racikan
    </Button>
  </div>
</template>
