|
|
|
@ -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<T> = { |
|
|
|
@ -198,20 +205,28 @@ function ShowCard({ id, title, subtitle, image, avatar, vip, data, onOpen }: Sho |
|
|
|
</div> |
|
|
|
<div className="mt-3"> |
|
|
|
<div className="flex items-center gap-[5px]"> |
|
|
|
<span className="grid h-5 w-5 place-items-center rounded-full bg-[#d6ceef] text-[11px]"> |
|
|
|
{avatar} |
|
|
|
</span> |
|
|
|
{avatar ? |
|
|
|
<img |
|
|
|
src={avatar || '/empty_project.png'} |
|
|
|
alt="" |
|
|
|
className="grid h-5 w-5 place-items-center rounded-full bg-[#d6ceef] text-[11px]"> |
|
|
|
</img> |
|
|
|
: |
|
|
|
<div className="grid h-5 w-5 place-items-center rounded-full bg-[#d6ceef] text-[11px]"> |
|
|
|
<DefaultAvatar></DefaultAvatar> |
|
|
|
</div> |
|
|
|
} |
|
|
|
<h3 className="truncate text-[16px] font-medium leading-tight text-[#333]"> |
|
|
|
{title} |
|
|
|
</h3> |
|
|
|
{vip ? ( |
|
|
|
{/* {vip ? ( |
|
|
|
<span className="rounded-full bg-[linear-gradient(90deg,#d6ceef_45%,#f0f0f0_100%)] px-2.5 py-0.5 text-[12px] font-medium leading-none text-[#5c3bc7]"> |
|
|
|
VIP |
|
|
|
</span> |
|
|
|
) : null} |
|
|
|
) : null} */} |
|
|
|
</div> |
|
|
|
<p className="mt-2 truncate text-[13px] leading-tight text-[#666]"> |
|
|
|
{subtitle} |
|
|
|
{subtitle || '-'} |
|
|
|
</p> |
|
|
|
</div> |
|
|
|
</article> |
|
|
|
@ -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 || '', |
|
|
|
}; |
|
|
|
|