<script setup lang="ts">
import type { HTMLAttributes } from 'vue';
import { cn } from '@/lib/utils';

const props = defineProps<{
  class?: HTMLAttributes['class'];
  colspan?: number;
  rowspan?: number;
  scope?: 'col' | 'row' | 'colgroup' | 'rowgroup';
}>();
</script>

<template>
  <th
    data-slot="table-head"
    :colspan="props.colspan"
    :rowspan="props.rowspan"
    :scope="props.scope"
    :class="
      cn(
        'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
        props.class,
      )
    "
  >
    <slot />
  </th>
</template>
