Files
webapp-conversation/app/components/header.tsx
lyzno1 05dcfcf0ca feat: migrate ESLint to v9 flat config
- Replace .eslintrc.json with eslint.config.mjs
- Simplify configuration using @antfu/eslint-config
- Add necessary ESLint plugin dependencies
- Disable overly strict style rules
- Set package.json type to module for ESM support
- Fix ESLint disable comment format

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-15 10:55:10 +08:00

47 lines
1.3 KiB
TypeScript

import type { FC } from 'react'
import React from 'react'
import {
Bars3Icon,
PencilSquareIcon,
} from '@heroicons/react/24/solid'
import AppIcon from '@/app/components/base/app-icon'
export interface IHeaderProps {
title: string
isMobile?: boolean
onShowSideBar?: () => void
onCreateNewChat?: () => void
}
const Header: FC<IHeaderProps> = ({
title,
isMobile,
onShowSideBar,
onCreateNewChat,
}) => {
return (
<div className="shrink-0 flex items-center justify-between h-12 px-3 bg-gray-100">
{isMobile
? (
<div
className='flex items-center justify-center h-8 w-8 cursor-pointer'
onClick={() => onShowSideBar?.()}
>
<Bars3Icon className="h-4 w-4 text-gray-500" />
</div>
)
: <div></div>}
<div className='flex items-center space-x-2'>
<AppIcon size="small" />
<div className=" text-sm text-gray-800 font-bold">{title}</div>
</div>
{isMobile
? (
<div className='flex items-center justify-center h-8 w-8 cursor-pointer' onClick={() => onCreateNewChat?.()} >
<PencilSquareIcon className="h-4 w-4 text-gray-500" />
</div>)
: <div></div>}
</div>
)
}
export default React.memo(Header)