fix: bug
This commit is contained in:
parent
0e249b27e1
commit
8f4285e8a2
|
|
@ -92,6 +92,40 @@ const GridItem = memo(
|
||||||
isVisible: boolean
|
isVisible: boolean
|
||||||
onSelect: (post: any) => void
|
onSelect: (post: any) => void
|
||||||
}) => {
|
}) => {
|
||||||
|
// 渲染状态标记
|
||||||
|
const renderStatusBadge = () => {
|
||||||
|
const status = post.status
|
||||||
|
|
||||||
|
// 成功状态不显示标记
|
||||||
|
if (status === 'completed' || status === 'success') {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// 失败状态
|
||||||
|
if (status === 'failed') {
|
||||||
|
return (
|
||||||
|
<Block
|
||||||
|
className="absolute left-[8px] top-[8px] z-20 flex-row items-center gap-[4px] border-2 border-black bg-[#e61e25] px-[8px] py-[4px] shadow-hard-black"
|
||||||
|
style={{ transform: [{ skewX: '6deg' }] }}
|
||||||
|
>
|
||||||
|
<Ionicons color="white" name="close-circle" size={14} />
|
||||||
|
<Text className="text-[10px] font-[900] italic text-white">失败</Text>
|
||||||
|
</Block>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 其他状态显示加载中
|
||||||
|
return (
|
||||||
|
<Block
|
||||||
|
className="absolute left-[8px] top-[8px] z-20 flex-row items-center gap-[4px] border-2 border-black bg-white px-[8px] py-[4px] shadow-hard-black"
|
||||||
|
style={{ transform: [{ skewX: '6deg' }] }}
|
||||||
|
>
|
||||||
|
<SpinningLoader />
|
||||||
|
<Text className="text-[10px] font-[900] italic text-black">生成中</Text>
|
||||||
|
</Block>
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Block className="relative" onClick={() => onSelect(post)}>
|
<Block className="relative" onClick={() => onSelect(post)}>
|
||||||
<Block
|
<Block
|
||||||
|
|
@ -103,6 +137,9 @@ const GridItem = memo(
|
||||||
</Block>
|
</Block>
|
||||||
{isSelected && <Block className="absolute inset-0 border-[3px] border-accent" />}
|
{isSelected && <Block className="absolute inset-0 border-[3px] border-accent" />}
|
||||||
|
|
||||||
|
{/* 状态标记 */}
|
||||||
|
{renderStatusBadge()}
|
||||||
|
|
||||||
{isSelectionMode && (
|
{isSelectionMode && (
|
||||||
<Block
|
<Block
|
||||||
className="absolute inset-0 z-30 items-center justify-center"
|
className="absolute inset-0 z-30 items-center justify-center"
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue