<script setup lang="ts">
import { Label as RadioLabel } from '~/components/pub/ui/label'
import { RadioGroup, RadioGroupItem } from '~/components/pub/ui/radio-group'
import { cn } from '~/lib/utils'

import * as DE from '~/components/pub/my-ui/doc-entry'

const props = defineProps<{
  label: string
  fieldName: string
  placeholder?: string
  colSpan?: number
}>()

const { label, fieldName, placeholder = 'Masukkan catatan' } = props
</script>

<template>
  <DE.Cell :col-span="colSpan || 1">
    <DE.Label :label-for="fieldName">
      {{ label }}
    </DE.Label>
    <DE.Field :id="fieldName">
      <FormField
        v-slot="{ componentField }"
        :name="fieldName"
      >
        <FormItem>
          <FormControl>
            <Textarea
              v-bind="componentField"
              :placeholder="placeholder"
            />
          </FormControl>
          <FormMessage />
        </FormItem>
      </FormField>
    </DE.Field>
  </DE.Cell>
</template>
