@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 1.41 kB
Source Map (JSON)
{"version":3,"file":"Title.mjs","names":["Title: FC<TitleProps>","Flexbox"],"sources":["../../../../src/chat/ChatItem/components/Title.tsx"],"sourcesContent":["import { type FC } from 'react';\n\nimport { Flexbox } from '@/Flex';\nimport { ChatItemProps } from '@/chat/ChatItem';\nimport { formatTime } from '@/utils/formatTime';\n\nimport { styles } from '../style';\n\nexport interface TitleProps {\n avatar: ChatItemProps['avatar'];\n placement?: ChatItemProps['placement'];\n showTitle?: ChatItemProps['showTitle'];\n time?: ChatItemProps['time'];\n titleAddon?: ChatItemProps['titleAddon'];\n}\n\nconst Title: FC<TitleProps> = ({ showTitle, placement = 'left', time, avatar, titleAddon }) => {\n return (\n <Flexbox\n align={'center'}\n className={placement === 'left' ? styles.nameLeft : styles.nameRight}\n direction={placement === 'left' ? 'horizontal' : 'horizontal-reverse'}\n gap={4}\n >\n {showTitle ? avatar.title || 'untitled' : undefined}\n {showTitle ? titleAddon : undefined}\n {time && <time>{formatTime(time)}</time>}\n </Flexbox>\n );\n};\n\nexport default Title;\n"],"mappings":";;;;;;AAgBA,MAAMA,SAAyB,EAAE,WAAW,YAAY,QAAQ,MAAM,QAAQ,iBAAiB;AAC7F,QACE,qBAACC;EACC,OAAO;EACP,WAAW,cAAc,SAAS,OAAO,WAAW,OAAO;EAC3D,WAAW,cAAc,SAAS,eAAe;EACjD,KAAK;;GAEJ,YAAY,OAAO,SAAS,aAAa;GACzC,YAAY,aAAa;GACzB,QAAQ,oBAAC,oBAAM,WAAW,KAAK,GAAQ;;GAChC;;AAId,oBAAe"}