diff --git a/src/components/HomeProjectsContent.tsx b/src/components/HomeProjectsContent.tsx index b46e5f59..d07bbaed 100644 --- a/src/components/HomeProjectsContent.tsx +++ b/src/components/HomeProjectsContent.tsx @@ -15,6 +15,7 @@ import { import { ArrowIcon, CloseIcon, + DefaultAvatar, LeftOutlinedIcon, SearchIcon, StartCreation, @@ -74,6 +75,12 @@ type CanvasTemplateItem = { desp: string; deleted: boolean; categoryName: string; + userInfo: { + avatar: string; + code: string; + id: number; + name: string; + } }; type ListResponse = { @@ -198,20 +205,28 @@ function ShowCard({ id, title, subtitle, image, avatar, vip, data, onOpen }: Sho
- - {avatar} - + {avatar ? + + + : +
+ +
+ }

{title}

- {vip ? ( + {/* {vip ? ( VIP - ) : null} + ) : null} */}

- {subtitle} + {subtitle || '-'}

@@ -499,8 +514,8 @@ function useProjectSectionState(pageSize: number, t: Translate, initialPage = 1) try { const data = await listCanvasWorkflows({ page: nextPage, pageSize }); const nextProjects = data.list - .filter((item) => !item.deleted) - .map((item) => mapWorkflowToProject(item)); + .filter((item) => !item.deleted) + .map((item) => mapWorkflowToProject(item)); setProjects((currentProjects) => options?.append ? [...currentProjects, ...nextProjects] : nextProjects ); @@ -1266,10 +1281,10 @@ function AllProjectsSection({ onBackClick }: { onBackClick: () => void }) { function mapTemplateToShow(item: CanvasTemplateItem, t: Translate): ShowData { return { id: item.id, - title: item.name || t("home.templateFallback"), - subtitle: item.desp || item.categoryName || t("home.templateSubtitleFallback"), + title: item.name || '', + subtitle: item.desp || '', image: item.coverUrl || '', - avatar: item.categoryName?.slice(0, 1) || item.name?.slice(0, 1) || t("home.templateAvatarFallback"), + avatar: item?.userInfo?.avatar || '', vip: item.type === 1, data: item.properties || '', }; diff --git a/src/components/icons/index.tsx b/src/components/icons/index.tsx index 52bbf569..904a7712 100644 --- a/src/components/icons/index.tsx +++ b/src/components/icons/index.tsx @@ -181,3 +181,9 @@ export const LeftOutlinedIcon = () => ( ); + +export const DefaultAvatar = () => { + return ( + + ) +} \ No newline at end of file