This commit is contained in:
YI FANG
2025-11-26 09:50:49 +08:00
commit 8155c9f95d
43 changed files with 7687 additions and 0 deletions

View File

@@ -0,0 +1,37 @@
import { Input } from '../ui';
interface TopBarProps {
search: string;
onSearch: (value: string) => void;
enableSearch?: boolean;
operatorName?: string;
onLoginClick?: () => void;
}
export const TopBar = ({ search, onSearch, enableSearch = true, operatorName, onLoginClick }: TopBarProps) => (
<header className='flex items-center gap-3 p-4 border-b bg-white'>
<div className='flex-1 flex items-center gap-3'>
{enableSearch ? (
<div className='w-[420px] max-w-[60vw]'>
<Input
placeholder='搜索姓名 / 体检号 / 套餐'
value={search}
onChange={(e) => onSearch(e.target.value)}
/>
</div>
) : (
<div className='text-sm text-gray-500'> · </div>
)}
</div>
<div className='flex items-center gap-3 text-xs'>
<button
onClick={onLoginClick}
className='px-3 py-1 rounded-2xl border bg-gray-50 hover:bg-gray-100 transition-colors cursor-pointer'
>
· {operatorName || '未登录'}
</button>
</div>
</header>
);