'use client';

import { ChatHeader } from '@lobehub/ui/chat';
import Link from 'next/link';
import { memo } from 'react';
import {createStyles} from 'antd-style';
import { Divider, Avatar } from "antd";
import { UserOutlined } from '@ant-design/icons';

import { ProductLogo } from '@/components/Branding';
import { isCustomBranding } from '@/const/version';

import CreateButton from '../../features/CreateButton';
import StoreSearchBar from '../../features/StoreSearchBar';

const useStyles = createStyles(({ css }) => ({
  dividerCen: css`
    width: 1px;
    height: 26px;
    background-color: #d8d8d8;
    margin: 8px 16px;
  `,
  inp: css`
    width: 283px;
    margin-right: 43px;
    background: #F3F6FF;
    &:hover, &:active, &:focus {
      border-color: transparent !important;
      background: #F3F6FF !important;
    }
  `,
  ledDiv: css `
    line-height: 52px;
    display: inline-block;
  `,
  leftTitle: css`
    font-size: 20px;
    color: #3d3d3d;
    display: inline-block
  `,
  nameSpn: css`
    margin-left: 8px;
    display: inline-block;
  `,
  serchIcon: css`
    color: #BCCEFF;
    font-size: 24px;
  `,
  topCenten: css`
    width: 100%;
    background: #FFFFFF;
    box-sizing: border-box;
    /* 分割线颜色 */
    border-width: 0px 0px 2px 0px;
    border-style: solid;
    border-color: rgba(187, 204, 253, 0.24);
  `,
}))
const title = {
  "/chat": '会话',
  "/discover/assistants": "助手",
  "/files": "工具",
  "/knowledge": "知识库",
  "/model": "模型",
  "/plugins": "插件",
  "/power": "算力",
  "/robot": "数字人",
}

const Header = memo(() => {
  const { styles, cx } = useStyles()
  return (
    <ChatHeader
      left={
        <div className={cx(styles.ledDiv)}>
          {/*<span className={cx(styles.leftTitle)}>集智AI</span>*/}
          {/*<Divider className={cx(styles.dividerCen)} type="vertical" />*/}
          {/*<span className={cx(styles.leftTitle)}>{title[window.location.pathname]}</span>*/}
        </div>
      }
      right={<>
        {/*<Avatar icon={<UserOutlined />} style={{ backgroundColor: '#90ACFF' }}/>*/}
        {/*<span className={cx(styles.nameSpn)}>张末末</span>*/}
      </>}
      style={{
        background: '#fff',
        position: 'relative',
        zIndex: 10,
      }}
      styles={{
        center: { flex: 1, maxWidth: 1440 },
        left: { flex: 1, maxWidth: 240 },
        right: { flex: 1, maxWidth: 240 },
      }}
    >
      <StoreSearchBar />
    </ChatHeader>
  );
});

export default Header;
