---
import { TabItemTagname } from './rehype-tabs';
import type { StarlightIcon } from '../components/Icons';

interface Props {
	icon?: StarlightIcon;
	label: string;
}

const { icon, label } = Astro.props;

if (!label) {
	throw new Error('Missing prop `label` on `<TabItem>` component.');
}
---

<TabItemTagname data-label={label} data-icon={icon}>
	<slot />
</TabItemTagname>
