// src/App.jsx import { useState } from "react"; function TabButton({ label, isActive, onSelect }) { return ( ); } function TabContent({ activeTab }) { const content = { profile: "This is the profile tab content.", settings: "This is the settings tab content.", }; return

{content[activeTab]}

; } function TabPanel() { const [activeTab, setActiveTab] = useState("profile"); return (
setActiveTab("profile")} /> setActiveTab("settings")} />
); } function App() { return ; } export default App; /* Notes: - activeTab lives in TabPanel, the shared parent of both buttons and the content area. - Each TabButton calls its own onSelect (a different arrow function per button, set up the way Chapter 4 covered) to tell the parent which tab to switch to. */