Tutorial Working

This commit is contained in:
2025-03-15 18:23:04 -04:00
parent a842c24d0d
commit ea0018bae2
15 changed files with 517 additions and 29 deletions

View File

@@ -3,6 +3,7 @@ import { HTMLProps, useState } from "react";
export interface Tab {
tabId?: string;
tabHeader: React.ReactNode;
headerClasses?: string;
tabContent: React.ReactNode;
@@ -39,6 +40,7 @@ export default function TabGroup(props: TabGroupProps){
{
tabs.map((tab, index) => (
<TabHeader
id={tab.tabId}
key={index}
tab={tab}
active={activeTab === index}
@@ -71,16 +73,19 @@ export default function TabGroup(props: TabGroupProps){
function TabHeader({
id,
tab,
onClick,
active
}:{
id?: string;
tab: Tab;
onClick: () => void;
active: boolean;
}){
return (
<div
id={id}
className={clsx(
tab.headerClasses,
"px-4 py-2 rounded-t-lg cursor-pointer whitespace-nowrap",