<script lang="ts">
    export let thScope: "row"|"col"|"rowgroup"|"colgroup"|"";
    export let colspan = "";
    export let type: "th"|"td" = "td";
    export let style;

    $: shared_props = {
        colspan: colspan || null,
        style: style || null,
        class: [type === "th" ? "int-table__cell--th" : "", "int-table__cell", $$restProps.class ?? ""].filter(Boolean).join(" "),
    };
</script>
{#if type === "th"}
    <th {thScope}
        {...shared_props}>
        <slot/>
    </th>
{/if}
{#if type === "td"}
    <td {...shared_props}>
        <slot/>
    </td>
{/if}
