forked from hamcha/tghandbook
22 lines
649 B
TypeScript
22 lines
649 B
TypeScript
import * as React from "react";
|
|
import WikiPage from "./components/WikiPage";
|
|
import TabList, { TabListItem } from "./components/TabList";
|
|
import { useState } from "react";
|
|
|
|
export default function App() {
|
|
const [tabs, setTabs] = useState<TabListItem[]>([
|
|
{ page: "Guide_to_medicine" },
|
|
// { page: "Guide_to_chemistry" },
|
|
]);
|
|
const [activeTab, setActiveTab] = useState(0);
|
|
return (
|
|
<React.Fragment>
|
|
<TabList tabs={tabs} active={activeTab} />
|
|
<section id="tabs">
|
|
{tabs.map((tab, i) => (
|
|
<WikiPage page={tab.page} visible={activeTab == i} />
|
|
))}
|
|
</section>
|
|
</React.Fragment>
|
|
);
|
|
}
|