import '../nui-heading/nui-heading.js'; import { html, nothing, type TemplateResult } from 'lit'; import type { NuiTabsViewState } from './types.js'; export type { NuiTabsViewState } from './types.js'; export interface NuiTabsHandlers { onTabClick: (value: string | number) => void; } export function renderTabs( state: NuiTabsViewState, handlers: NuiTabsHandlers, ): TemplateResult { const lists = state.lists || []; const panels = state.panels || []; return html`
${lists.map((list) => { const isActive = list.value === state.activeValue; return html``; })}
${panels.map((panel) => { const isHidden = panel.value !== state.activeValue; return html`

${panel.content || ''}

`; })}
`; }