feat: Tab Common

This commit is contained in:
sonnguyenkieio 2021-09-07 12:16:04 +07:00 committed by GitHub
parent ceb144ee57
commit 0eb29aed29
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,22 +1,19 @@
import classNames from "classnames";
import React from "react"
import s from './TabItem.module.scss'
interface TabItemProps {
active: string;
active: boolean;
children: string;
onClick: () => void;
onClick: (tabIndex: number, tabPane: string) => void;
}
const TabItem = ({ active = "", children, onClick } : TabItemProps) => {
const TabItem = ({ active = false, children, onClick } : TabItemProps) => {
return (
<span onClick={onClick} className={classNames(s.tabItem, {
[s[active]]: active
})}>
<span onClick={onClick} className={active ? s.tabItemActive : s.tabItem} >
{children}
</span>
)
}
export default TabItem;
export default TabItem;