Initial commit

This commit is contained in:
John Wang
2023-05-15 08:51:32 +08:00
commit db896255d6
744 changed files with 56028 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
'use client'
import React, { FC } from 'react'
import cn from 'classnames'
import s from './style.module.css'
export interface ITabHeaderProps {
items: {
id: string
name: string
extra?: React.ReactNode
}[]
value: string
onChange: (value: string) => void
}
const TabHeader: FC<ITabHeaderProps> = ({
items,
value,
onChange
}) => {
return (
<div className='flex space-x-4 border-b border-gray-200 '>
{items.map(({ id, name, extra }) => (
<div
key={id}
className={cn(id === value ? `${s.itemActive} text-gray-900` : 'text-gray-500', 'relative flex items-center pb-1.5 leading-6 cursor-pointer')}
onClick={() => onChange(id)}
>
<div className='text-base font-semibold'>{name}</div>
{extra ? extra : ''}
</div>
))}
</div>
)
}
export default React.memo(TabHeader)

View File

@@ -0,0 +1,9 @@
.itemActive::after {
content: '';
position: absolute;
bottom: -1px;
left: 0;
width: 100%;
height: 2px;
background-color: #155EEF;
}