perf: text and avatar
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
import React from 'react';
|
||||
import { Box, Flex, Image, Button } from '@chakra-ui/react';
|
||||
import { Box, Flex, Button, Tooltip } from '@chakra-ui/react';
|
||||
import type { ShareModelItem } from '@/types/model';
|
||||
import { useRouter } from 'next/router';
|
||||
import MyIcon from '@/components/Icon';
|
||||
import styles from '../index.module.scss';
|
||||
import Avatar from '@/components/Avatar';
|
||||
|
||||
const ShareModelList = ({
|
||||
models = [],
|
||||
@@ -27,27 +28,29 @@ const ShareModelList = ({
|
||||
borderRadius={'md'}
|
||||
>
|
||||
<Flex alignItems={'center'}>
|
||||
<Image
|
||||
<Avatar
|
||||
src={model.avatar}
|
||||
alt={'avatar'}
|
||||
w={['28px', '36px']}
|
||||
h={['28px', '36px']}
|
||||
objectFit={'cover'}
|
||||
borderRadius={'50%'}
|
||||
/>
|
||||
<Box fontWeight={'bold'} fontSize={'lg'} ml={5}>
|
||||
{model.name}
|
||||
</Box>
|
||||
</Flex>
|
||||
<Box
|
||||
flex={1}
|
||||
className={styles.intro}
|
||||
my={4}
|
||||
fontSize={'sm'}
|
||||
wordBreak={'break-all'}
|
||||
color={'blackAlpha.600'}
|
||||
>
|
||||
{model.share.intro || '这个AI助手还没有介绍~'}
|
||||
</Box>
|
||||
<Tooltip label={model.share.intro}>
|
||||
<Box
|
||||
className={styles.intro}
|
||||
flex={1}
|
||||
my={4}
|
||||
fontSize={'sm'}
|
||||
wordBreak={'break-all'}
|
||||
color={'blackAlpha.600'}
|
||||
>
|
||||
{model.share.intro || '这个 应用 还没有介绍~'}
|
||||
</Box>
|
||||
</Tooltip>
|
||||
|
||||
<Flex justifyContent={'space-between'}>
|
||||
<Flex
|
||||
alignItems={'center'}
|
||||
@@ -66,21 +69,11 @@ const ShareModelList = ({
|
||||
<Button
|
||||
size={'sm'}
|
||||
variant={'outline'}
|
||||
w={['60px', '80px']}
|
||||
w={['60px', '70px']}
|
||||
onClick={() => router.push(`/chat?modelId=${model._id}`)}
|
||||
>
|
||||
体验
|
||||
</Button>
|
||||
{model.share.isShareDetail && (
|
||||
<Button
|
||||
ml={4}
|
||||
size={'sm'}
|
||||
w={['60px', '80px']}
|
||||
onClick={() => router.push(`/model?modelId=${model._id}`)}
|
||||
>
|
||||
详情
|
||||
</Button>
|
||||
)}
|
||||
</Box>
|
||||
</Flex>
|
||||
</Flex>
|
||||
|
||||
Reference in New Issue
Block a user