mirror of
https://github.com/vercel/commerce.git
synced 2025-07-21 11:51:20 +00:00
✨ feat: Tab Common
This commit is contained in:
parent
ceb144ee57
commit
0eb29aed29
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user