<template>
  <td
    :class="`tf-table-td ${column.prop
      ? `cell-prop-${column.prop}`
      : ''}`"
  >
    <slot>
      <template v-if="rowData[column.prop]">
        {{ rowData[column.prop] }}
      </template>
      <slot
        v-else
        name="emptyCell"
      >
        &mdash;
      </slot>
    </slot>
  </td>
</template>

<script>
  /**
   * TfTableTd is a component that is used within the TfTable component and controls the template for the individual table data cell.
   *
   * @vuedoc
   * @exports TfTable/Td
   * @category Components
   */
  export default {
    name: 'TfTableTd',
    props: {
      column: {
        type: Object,
        default: () => ({}),
      },
      rowData: {
        type: Object,
        default: () => ({}),
      },
    },
  };
</script>
