28 lines
739 B
JavaScript
28 lines
739 B
JavaScript
|
const isActiveTab = (currentTab, activeTab) =>
|
||
|
currentTab === activeTab ? "border-t" : "";
|
||
|
|
||
|
const Tab = ({ activeTab, setActiveTab }) => (
|
||
|
<div className="flex items-center justify-center text-center gap-5 border-t mb-4">
|
||
|
<button
|
||
|
onClick={() => setActiveTab("photos")}
|
||
|
className={`uppercase tracking-tight font-semibold text-sm border-black pt-3 px-3 ${isActiveTab(
|
||
|
"photos",
|
||
|
activeTab
|
||
|
)}`}
|
||
|
>
|
||
|
Photos
|
||
|
</button>
|
||
|
<button
|
||
|
onClick={() => setActiveTab("videos")}
|
||
|
className={`uppercase tracking-tight font-semibold text-sm pt-3 px-3 border-black ${isActiveTab(
|
||
|
"videos",
|
||
|
activeTab
|
||
|
)}`}
|
||
|
>
|
||
|
Videos
|
||
|
</button>
|
||
|
</div>
|
||
|
);
|
||
|
|
||
|
export default Tab;
|