import { $, html } from "sigpro";
$.component(
"c-tab",
(props, { emit, slot }) => {
const groupName = `tab-group-${Math.random().toString(36).substring(2, 9)}`;
const items = () => props.items() || [];
return html`
`tabs ${props.ui() ?? "tabs-lifted"}`}>
${() =>
items().map(
(item) => html`
props.value() === item.value}
@change=${() => {
if (typeof props.value === "function") props.value(item.value);
emit("change", item.value);
}} />
`,
)}
${() => slot(props.value())}
`;
},
["items", "value", "ui"],
);