import React from "react";

import style from "./Tab.module.css";

function Tab({ tab, tabList, setTab }) {
	return (
		<div className={style.tab_switch}>
			<ul>
				{tabList.map((thisTab) => (
					<li
						className={tab.id === thisTab.id ? style.focus : ""}
						onClick={() => setTab(thisTab)}
					>
						{thisTab.text}
					</li>
				))}
			</ul>
		</div>
	);
}

export default Tab;
