mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-29 09:44:47 +00:00
perf: optimize simple app history (#2782)
* simple app history * ui * extract context content into hooks
This commit is contained in:
@@ -2,6 +2,7 @@ import { Box, BoxProps, Flex } from '@chakra-ui/react';
|
||||
import { ParentTreePathItemType } from '@fastgpt/global/common/parentFolder/type';
|
||||
import React, { useMemo } from 'react';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
|
||||
const FolderPath = (props: {
|
||||
paths: ParentTreePathItemType[];
|
||||
@@ -35,7 +36,7 @@ const FolderPath = (props: {
|
||||
return paths.length === 0 && !!FirstPathDom ? (
|
||||
<>{FirstPathDom}</>
|
||||
) : (
|
||||
<Flex flex={1} ml={-1.5}>
|
||||
<Flex flex={1}>
|
||||
{concatPaths.map((item, i) => (
|
||||
<Flex key={item.parentId || i} alignItems={'center'}>
|
||||
<Box
|
||||
@@ -51,6 +52,7 @@ const FolderPath = (props: {
|
||||
}
|
||||
: {
|
||||
cursor: 'pointer',
|
||||
fontWeight: 'medium',
|
||||
color: 'myGray.500',
|
||||
_hover: {
|
||||
bg: 'myGray.100',
|
||||
@@ -64,9 +66,7 @@ const FolderPath = (props: {
|
||||
{item.parentName}
|
||||
</Box>
|
||||
{i !== concatPaths.length - 1 && (
|
||||
<Box mx={1.5} color={'myGray.500'}>
|
||||
/
|
||||
</Box>
|
||||
<MyIcon name={'common/line'} color={'myGray.500'} mx={1} width={'5px'} />
|
||||
)}
|
||||
</Flex>
|
||||
))}
|
||||
|
Reference in New Issue
Block a user