代码优化

main
jiangxucong 5 months ago
parent 527a66af95
commit bf3c05975e

@ -1,29 +1,13 @@
import { ActionIcon } from '@lobehub/ui';
import {Image, Tooltip} from 'antd';
import { LucideX } from 'lucide-react';
import {Image} from 'antd';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
import UserAvatar from '@/features/User/UserAvatar';
import UserPanel from '@/features/User/UserPanel';
import { useUserStore } from '@/store/user';
import { preferenceSelectors } from '@/store/user/selectors';
// import UserAvatar from '@/features/User/UserAvatar';
// import UserPanel from '@/features/User/UserPanel';
const Avatar = memo(() => {
const { t } = useTranslation('common');
const hideSettingsMoveGuide = useUserStore(preferenceSelectors.hideSettingsMoveGuide);
const updateGuideState = useUserStore((s) => s.updateGuideState);
const content = (
<UserPanel>
<UserAvatar clickable />
</UserPanel>
);
return (
<>
<Image alt={""} preview={false} src="/images/logo.png" />
</>
)
});

@ -1,7 +1,7 @@
import { ActionIcon } from '@lobehub/ui';
import { Compass, FolderClosed, MessageSquare } from 'lucide-react';
// import { ActionIcon } from '@lobehub/ui';
// import { Compass, FolderClosed, MessageSquare } from 'lucide-react';
import Link from 'next/link';
import {memo, useEffect, useState} from 'react';
import {memo, useState} from 'react';
import { useTranslation } from 'react-i18next';
import { useGlobalStore } from '@/store/global';
@ -10,17 +10,20 @@ import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfi
import { useSessionStore } from '@/store/session';
import { useUserStore } from '@/store/user';
import { createStyles } from 'antd-style';
import {Button, Image} from "antd";
import { Image } from "antd";
const useStyles = createStyles(({ css, token }) => ({
const useStyles = createStyles(({ css }) => ({
iconImg: css`
width: 48px;
height: 48px;
`,
iconText: css`
text-align: center;
color: #fff;
`,
iconImg: css`
width: 48px;
height: 48px;
iconSelectText: css`
color: #0044FF;
`,
linkUrl: css`
width: 100%;
@ -29,34 +32,26 @@ const useStyles = createStyles(({ css, token }) => ({
linkclic: css`
background-color: #fff;
`,
iconSelectText: css`
color: #0044FF;
`,
}));
export interface TopActionProps {
tab?: SidebarTabKey;
}
const TopActions = memo<TopActionProps>(({ tab }) => {
const getUserId = (s) => s.user?.id
const TopActions = memo<TopActionProps>(() => {
const { t } = useTranslation('common');
const switchBackToChat = useGlobalStore((s) => s.switchBackToChat);
const { showMarket, enableKnowledgeBase } = useServerConfigStore(featureFlagsSelectors);
const { styles, cx } = useStyles()
const [value, setValue] = useState("chat")
const getUserId = (s: UserStore) => s.user?.id
const userId = getUserId(useUserStore.getState())
console.log(userId,'3837373266262266')
const testFuc = (s: UserStore) => {
console.log(s,'999999999')
}
testFuc(useUserStore.getState())
return (
<div style={{ width: '100%', textAlign: 'center'}}>
<div style={{ textAlign: 'center', width: '100%'}}>
<Link
aria-label={t('tab.chat')}
className={value === '/chat' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)}
href={'/chat'}
className={value == '/chat' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)}
onClick={(e) => {
e.preventDefault();
setValue("/chat")
@ -65,48 +60,48 @@ const TopActions = memo<TopActionProps>(({ tab }) => {
}}
>
<Image alt={"chat"} className={cx(styles.iconImg)} preview={false} src="/images/hh.png" />
<div className={value == '/chat' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/chat' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
{enableKnowledgeBase && (
<Link className={value == '/discover/assistants' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.files')} href={`/discover/assistants?userid=${userId}`} onClick={() => {setValue("/discover/assistants"); window.localStorage.setItem("nowChat", "")}}>
<Link aria-label={t('tab.files')} className={value === '/discover/assistants' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/assistants?userid=${userId}`} onClick={() => {setValue("/discover/assistants"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"files"} className={cx(styles.iconImg)} preview={false} src="/images/zs.png" />
<div className={value == '/discover/assistants' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/discover/assistants' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
{showMarket && (
<Link className={value == '/files' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.discover')} href={'/files'} onClick={() => {setValue("/files"); window.localStorage.setItem("nowChat", "")}}>
<Link aria-label={t('tab.discover')} className={value === '/files' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/files'} onClick={() => {setValue("/files"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"discover"} className={cx(styles.iconImg)} preview={false} src="/images/gj.png" />
<div className={value == '/files' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/files' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
{showMarket && (
<Link className={value == '/model' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.Model')} href={`/discover/models?userid=${userId}`} onClick={() => {setValue("/model"); window.localStorage.setItem("nowChat", "")}}>
<Link aria-label={t('tab.Model')} className={value === '/model' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/models?userid=${userId}`} onClick={() => {setValue("/model"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"model"} className={cx(styles.iconImg)} preview={false} src="/images/mx.png" />
<div className={value == '/model' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/model' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
{showMarket && (
<Link className={value == '/robot' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.robot')} href={'/robot'} onClick={() => {setValue("/robot"); window.localStorage.setItem("nowChat", "")}}>
<Link aria-label={t('tab.robot')} className={value === '/robot' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/robot'} onClick={() => {setValue("/robot"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"robot"} className={cx(styles.iconImg)} preview={false} src="/images/szr.png" />
<div className={value == '/robot' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/robot' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
{showMarket && (
<Link className={value == '/plugins' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.Plugins')} href={`/discover/plugins?userid=${userId}`} onClick={() => {setValue("/plugins"); window.localStorage.setItem("nowChat", "")}}>
<Link aria-label={t('tab.Plugins')} className={value === '/plugins' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={`/discover/plugins?userid=${userId}`} onClick={() => {setValue("/plugins"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"plugins"} className={cx(styles.iconImg)} preview={false} src="/images/cj.png" />
<div className={value == '/plugins' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/plugins' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
{showMarket && (
<Link className={value == '/power' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.Power')} href={'/power'} onClick={() => {setValue("/power"); window.localStorage.setItem("nowChat", "")}}>
<Link aria-label={t('tab.Power')} className={value === '/power' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/power'} onClick={() => {setValue("/power"); window.localStorage.setItem("nowChat", "")}}>
<Image alt={"power"} className={cx(styles.iconImg)} preview={false} src="/images/sl.png" />
<div className={value == '/power' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/power' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
{showMarket && (
<Link className={value == '/knowledge' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} aria-label={t('tab.knowledge')} href={'/knowledge'} onClick={() => {setValue("/knowledge")}}>
<Link aria-label={t('tab.knowledge')} className={value === '/knowledge' ? cx(styles.linkUrl, styles.linkclic) : cx(styles.linkUrl)} href={'/knowledge'} onClick={() => {setValue("/knowledge")}}>
<Image className={cx(styles.iconImg)} preview={false} src="/images/zsk.png" />
<div className={value == '/knowledge' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
<div className={value === '/knowledge' ? cx(styles.iconText, styles.iconSelectText) : cx(styles.iconText) }></div>
</Link>
)}
</div>

@ -6,7 +6,6 @@ import { memo } from 'react';
import { useActiveTabKey } from '@/hooks/useActiveTabKey';
import Avatar from './Avatar';
import BottomActions from './BottomActions';
import TopActions from './TopActions';
const Nav = memo(() => {
@ -14,8 +13,8 @@ const Nav = memo(() => {
return (
<SideNav
avatar={<Avatar />}
// bottomActions={<BottomActions />}
style={{ height: '100%', zIndex: 100, width: '100px', backgroundColor: '#2E62FF' }}
bottomActions={<></>}
style={{ backgroundColor: '#2E62FF', height: '100%', width: '100px', zIndex: 100 }}
topActions={<TopActions tab={sidebarKey} />}
/>
);

@ -15,9 +15,9 @@ const ChatConversation = () => {
<ChatInput />
<div style={{ fontSize: '13px', color: '#909090', backgroundColor: "rgba(200, 205, 220, 0.2)"}}>
<div style={{ backgroundColor: "rgba(200, 205, 220, 0.2)", color: '#909090', fontSize: '13px'}}>
<span style={{ display: 'inline-block', }}>:</span>
<span style={{ display: 'inline-block', margin: "0px 13px", fontSize: "20px" }}>&crarr;</span>
<span style={{ display: 'inline-block', fontSize: "20px", margin: "0px 13px" }}>&crarr;</span>
<span> </span>
<span style={{ display: 'inline-block', fontSize: "20px", marginLeft: '30px', marginRight: '11px' }}>&crarr;</span>
<span> + Ctrl </span>

@ -1,23 +1,23 @@
import { Icon } from '@lobehub/ui';
import { Button, Skeleton, Space } from 'antd';
// import { Icon } from '@lobehub/ui';
import { Button, Space } from 'antd';
import { createStyles } from 'antd-style';
import { ChevronUp, CornerDownLeft, LucideCommand, Eraser } from 'lucide-react';
// import { ChevronUp, CornerDownLeft, LucideCommand } from 'lucide-react';
import { rgba } from 'polished';
import { memo, useEffect, useState } from 'react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Center, Flexbox } from 'react-layout-kit';
import { Flexbox } from 'react-layout-kit';
import StopLoadingIcon from '@/components/StopLoading';
import SaveTopic from '@/features/ChatInput/Topic';
// import SaveTopic from '@/features/ChatInput/Topic';
import { useSendMessage } from '@/features/ChatInput/useSend';
import { useChatStore } from '@/store/chat';
import { chatSelectors } from '@/store/chat/selectors';
import { useUserStore } from '@/store/user';
import { preferenceSelectors } from '@/store/user/selectors';
import { isMacOS } from '@/utils/platform';
// import { useUserStore } from '@/store/user';
// import { preferenceSelectors } from '@/store/user/selectors';
// import { isMacOS } from '@/utils/platform';
import LocalFiles from '../FilePreview';
import SendMore from './SendMore';
// import LocalFiles from '../FilePreview';
// import SendMore from './SendMore';
import {HighlightOutlined, SendOutlined} from "@ant-design/icons";
const useStyles = createStyles(({ css, prefixCls, token }) => {
@ -27,10 +27,6 @@ const useStyles = createStyles(({ css, prefixCls, token }) => {
width: 28px;
}
`,
btnDiv: css`
height: 50%;
width: 100px;
`,
btn: css`
width: 96px;
height: 80%;
@ -39,6 +35,10 @@ const useStyles = createStyles(({ css, prefixCls, token }) => {
color: #2E62FF !important;
font-size: 16px;
`,
btnDiv: css`
height: 50%;
width: 100px;
`,
btnSend: css`
width: 96px;
height: 80%;
@ -77,47 +77,47 @@ interface FooterProps {
setExpand?: (expand: boolean) => void;
}
const Footer = memo<FooterProps>(({ setExpand, expand, clearClick }) => {
const Footer = memo<FooterProps>(({ clearClick, setExpand }) => {
const { t } = useTranslation('chat');
const { theme, styles } = useStyles();
const { styles } = useStyles();
const [isAIGenerating, stopGenerateMessage] = useChatStore((s) => [
chatSelectors.isAIGenerating(s),
s.stopGenerateMessage,
]);
const [useCmdEnterToSend] = useUserStore((s) => [preferenceSelectors.useCmdEnterToSend(s)]);
// const [useCmdEnterToSend] = useUserStore((s) => [preferenceSelectors.useCmdEnterToSend(s)]);
const { send: sendMessage, canSend } = useSendMessage();
const [isMac, setIsMac] = useState<boolean>();
useEffect(() => {
setIsMac(isMacOS());
}, [setIsMac]);
const cmdEnter = (
<Flexbox gap={2} horizontal>
{typeof isMac === 'boolean' ? (
<Icon icon={isMac ? LucideCommand : ChevronUp} />
) : (
<Skeleton.Node active style={{ height: '100%', width: 12 }}>
{' '}
</Skeleton.Node>
)}
<Icon icon={CornerDownLeft} />
</Flexbox>
);
const enter = (
<Center>
<Icon icon={CornerDownLeft} />
</Center>
);
const sendShortcut = useCmdEnterToSend ? cmdEnter : enter;
const wrapperShortcut = useCmdEnterToSend ? enter : cmdEnter;
// const [isMac, setIsMac] = useState<boolean>();
// useEffect(() => {
// setIsMac(isMacOS());
// }, [setIsMac]);
// const cmdEnter = (
// <Flexbox gap={2} horizontal>
// {typeof isMac === 'boolean' ? (
// <Icon icon={isMac ? LucideCommand : ChevronUp} />
// ) : (
// <Skeleton.Node active style={{ height: '100%', width: 12 }}>
// {' '}
// </Skeleton.Node>
// )}
// <Icon icon={CornerDownLeft} />
// </Flexbox>
// );
// const enter = (
// <Center>
// <Icon icon={CornerDownLeft} />
// </Center>
// );
// const sendShortcut = useCmdEnterToSend ? cmdEnter : enter;
// const wrapperShortcut = useCmdEnterToSend ? enter : cmdEnter;
const handleClickClear = () => {
clearClick()
@ -127,12 +127,12 @@ const Footer = memo<FooterProps>(({ setExpand, expand, clearClick }) => {
<Flexbox
align={'end'}
className={styles.overrideAntdIcon}
style={{ display: 'inline-block', height: '100%', width: "140px" }}
distribution={'space-between'}
flex={'none'}
gap={8}
horizontal
padding={'0 24px'}
style={{ display: 'inline-block', height: '100%', width: "140px" }}
>
{/*<Flexbox align={'center'} gap={8} horizontal style={{ overflow: 'hidden' }}>*/}
{/* {expand && <LocalFiles />}*/}

@ -8,7 +8,6 @@ import {
CHAT_TEXTAREA_HEIGHT,
CHAT_TEXTAREA_MAX_HEIGHT,
HEADER_HEIGHT,
CHAT_TEXTAREA_MIN_HEIGHT,
} from '@/const/layoutTokens';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
@ -59,9 +58,9 @@ const DesktopChatInput = memo(() => {
style={{ minHeight: CHAT_TEXTAREA_HEIGHT, position: 'relative' }}
>
<Head expand={expand} setExpand={setExpand} />
<div style={{ height: '100%', display: 'flex' }}>
<div style={{ display: 'flex', height: '100%'}}>
<TextArea setExpand={setExpand} />
<Footer expand={expand} setExpand={setExpand} clearClick={() => clearClick()} />
<Footer clearClick={() => clearClick()} expand={expand} setExpand={setExpand} />
</div>
</Flexbox>
</DraggablePanel>

@ -86,7 +86,6 @@ const TopicListContent = memo(() => {
)}
<Virtuoso
// components={{ ScrollSeekPlaceholder: Placeholder }}
style={{ height: "150px" }}
computeItemKey={(_, item) => item.id}
data={topics}
fixedItemHeight={44}
@ -94,6 +93,7 @@ const TopicListContent = memo(() => {
itemContent={itemContent}
overscan={44 * 10}
ref={virtuosoRef}
style={{ height: "150px" }}
// scrollSeekConfiguration={{
// enter: (velocity) => Math.abs(velocity) > 350,
// exit: (velocity) => Math.abs(velocity) < 10,

@ -1,35 +1,35 @@
'use client';
import { ActionIcon } from '@lobehub/ui';
import { PanelRightClose, PanelRightOpen } from 'lucide-react';
// import { ActionIcon } from '@lobehub/ui';
// import { PanelRightClose, PanelRightOpen } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
// import { useTranslation } from 'react-i18next';
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
// import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
// import { useGlobalStore } from '@/store/global';
// import { systemStatusSelectors } from '@/store/global/selectors';
// import { featureFlagsSelectors, useServerConfigStore } from '@/store/serverConfig';
import SettingButton from '../../../features/SettingButton';
import ShareButton from '../../../features/ShareButton';
// import SettingButton from '../../../features/SettingButton';
// import ShareButton from '../../../features/ShareButton';
import {Button} from "antd";
import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';
const HeaderAction = memo(() => {
const { t } = useTranslation('chat');
// const { t } = useTranslation('chat');
const [showAgentSettings, toggleConfig] = useGlobalStore((s) => [
systemStatusSelectors.showChatSideBar(s),
s.toggleChatSideBar,
]);
// const [showAgentSettings, toggleConfig] = useGlobalStore((s) => [
// systemStatusSelectors.showChatSideBar(s),
// s.toggleChatSideBar,
// ]);
const { isAgentEditable } = useServerConfigStore(featureFlagsSelectors);
// const { isAgentEditable } = useServerConfigStore(featureFlagsSelectors);
const openChatSettings = useOpenChatSettings();
return (
<>
<Button onClick={() => openChatSettings()} style={{ borderColor: '#2E62FF', color: "#2E62FF" }} shape="round"></Button>
<Button onClick={() => openChatSettings()} shape="round" style={{ borderColor: '#2E62FF', color: "#2E62FF" }}></Button>
{/*<ShareButton />*/}
{/*<ActionIcon*/}
{/* icon={showAgentSettings ? PanelRightClose : PanelRightOpen}*/}

@ -1,28 +1,28 @@
'use client';
import { ActionIcon, Avatar, ChatHeaderTitle } from '@lobehub/ui';
import { Avatar } from '@lobehub/ui';
import { Skeleton } from 'antd';
import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
// import { PanelLeftClose, PanelLeftOpen } from 'lucide-react';
import { Suspense, memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';
import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
// import { DESKTOP_HEADER_ICON_SIZE } from '@/const/layoutTokens';
import { useOpenChatSettings } from '@/hooks/useInterceptingRoutes';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
// import { useGlobalStore } from '@/store/global';
// import { systemStatusSelectors } from '@/store/global/selectors';
import { useSessionStore } from '@/store/session';
import { sessionMetaSelectors, sessionSelectors } from '@/store/session/selectors';
import { useInitAgentConfig } from '../../useInitAgentConfig';
import Tags from './Tags';
// import Tags from './Tags';
const Main = memo(() => {
const { t } = useTranslation('chat');
useInitAgentConfig();
const [init, isInbox, title, description, avatar, backgroundColor] = useSessionStore((s) => [
const [init, isInbox, title, avatar, backgroundColor] = useSessionStore((s) => [
sessionSelectors.isSomeSessionActive(s),
sessionSelectors.isInboxSession(s),
sessionMetaSelectors.currentAgentTitle(s),
@ -34,9 +34,9 @@ const Main = memo(() => {
const openChatSettings = useOpenChatSettings();
const displayTitle = isInbox ? t('inbox.title') : title;
const displayDesc = isInbox ? t('inbox.desc') : description;
const showSessionPanel = useGlobalStore(systemStatusSelectors.showSessionPanel);
const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);
// const displayDesc = isInbox ? t('inbox.desc') : description;
// const showSessionPanel = useGlobalStore(systemStatusSelectors.showSessionPanel);
// const updateSystemStatus = useGlobalStore((s) => s.updateSystemStatus);
return !init ? (
<Flexbox horizontal>
@ -73,7 +73,7 @@ const Main = memo(() => {
<div>
<div style={{ fontSize: "15px" }}>{displayTitle}</div>
{/*<ChatHeaderTitle desc={displayDesc} title={displayTitle} />*/}
<div style={{ fontSize: '12px', color: "#A7A0A0" }}>{displayTitle}</div>
<div style={{ color: "#A7A0A0", fontSize: '12px' }}>{displayTitle}</div>
</div>
</Flexbox>
);

@ -17,7 +17,6 @@ const TitleTags = memo(() => {
agentSelectors.currentAgentModel(s),
agentSelectors.hasKnowledge(s),
]);
console.log(model, 20202020)
const plugins = useAgentStore(agentSelectors.currentAgentPlugins, isEqual);
const enabledKnowledge = useAgentStore(agentSelectors.currentEnabledKnowledge, isEqual);

@ -3,16 +3,16 @@
import { DraggablePanel, DraggablePanelContainer } from '@lobehub/ui';
import { createStyles, useResponsive } from 'antd-style';
import isEqual from 'fast-deep-equal';
import { PropsWithChildren, memo, useEffect, useState } from 'react';
import { memo, useEffect, useState } from 'react';
import SafeSpacing from '@/components/SafeSpacing';
// import SafeSpacing from '@/components/SafeSpacing';
import { CHAT_SIDEBAR_WIDTH } from '@/const/layoutTokens';
import { useChatStore } from '@/store/chat';
import { chatPortalSelectors } from '@/store/chat/slices/portal/selectors';
import { useGlobalStore } from '@/store/global';
import { systemStatusSelectors } from '@/store/global/selectors';
import {Form, Image} from "antd";
import {EditFilled, EditTwoTone} from "@ant-design/icons";
import {EditFilled} from "@ant-design/icons";
import TopicListContent from "@/app/(main)/chat/(workspace)/@topic/features/TopicListContent";
import Header from "@/app/(main)/chat/(workspace)/@topic/features/Header";
@ -31,11 +31,6 @@ const useStyles = createStyles(({ css, token }) => ({
header: css`
border-block-end: 1px solid ${token.colorBorder};
`,
topTitle: css`
font-size: 18px;
display: inline-block;
width: calc(100% - 24px)
`,
topEdit: css`
display: inline-block;
text-align: center;
@ -44,9 +39,14 @@ const useStyles = createStyles(({ css, token }) => ({
background-color: #AFC1FF;
color: #fff;
`,
topTitle: css`
font-size: 18px;
display: inline-block;
width: calc(100% - 24px)
`,
}));
const TopicPanel = memo(({ children }: PropsWithChildren) => {
const TopicPanel = memo(() => {
const { styles } = useStyles();
const [form] = Form.useForm()
const { md = true, lg = true } = useResponsive();
@ -87,8 +87,8 @@ const TopicPanel = memo(({ children }: PropsWithChildren) => {
style={{
flex: 'none',
height: '100%',
maxHeight: '100vh',
border: "1px solid #ddd",
maxHeight: '100vh',
minWidth: CHAT_SIDEBAR_WIDTH,
}}
>
@ -97,14 +97,14 @@ const TopicPanel = memo(({ children }: PropsWithChildren) => {
<div className={styles.topEdit}><EditFilled /></div>
</div>
<div><Image alt="头像" preview={false} src="/images/zsImage.png" /></div>
<Form layout="horizontal" colon={false} form={form} labelCol={{ span: 6 }} wrapperCol={{ span: 18 }}>
<Form.Item name="name" label="名称">
<Form colon={false} form={form} labelCol={{ span: 6 }} layout="horizontal" wrapperCol={{ span: 18 }}>
<Form.Item label="名称" name="name">
<span style={{ width: "18px" }}>Linda</span>
</Form.Item>
<Form.Item name="jj" label="简介">
<Form.Item label="简介" name="jj">
<span style={{ color: "#999999", fontSize: '13px' }}></span>
</Form.Item>
<Form.Item name="rw" label="任务">
<Form.Item label="任务" name="rw">
<span style={{ color: "#999999", fontSize: '13px' }}></span>
</Form.Item>
</Form>

Loading…
Cancel
Save