ffebaa7249
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 57s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m9s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 3m37s
CI/CD Pipeline / Build Staging Web Image (push) Successful in 3m44s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 3m44s
CI/CD Pipeline / Validate - Code Quality (push) Successful in 6m35s
CI/CD Pipeline / Build Staging API Image (push) Successful in 6m46s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Successful in 1m13s
CI/CD Pipeline / ACR Image Cleanup (push) Successful in 38s
CI/CD Pipeline / Staging E2E Tests (push) Successful in 1m24s
CI/CD Pipeline / Integration Tests (push) Successful in 4m8s
CI/CD Pipeline / Unit Tests (push) Successful in 11m20s
CI/CD Pipeline / Staging API Integration Tests (push) Successful in 3m26s
CI/CD Pipeline / Canary Release to Production (push) Failing after 1024h34m53s
CI/CD Pipeline / Deploy Production (push) Failing after 1024h34m55s
CI/CD Pipeline / CI Gate (push) Failing after 1024h34m55s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1024h34m56s
CI/CD Pipeline / Build Production API Image (push) Failing after 1024h34m56s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1024h46m15s
CI/CD Pipeline / PR Build API Image (push) Failing after 1024h46m17s
CI/CD Pipeline / Frontend Lint (push) Failing after 1024h46m18s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1024h46m20s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1025h8m10s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1025h8m12s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1025h19m32s
Co-authored-by: xiaoxia <dev@xiaoxiajianji.com> Co-committed-by: xiaoxia <dev@xiaoxiajianji.com>
43 lines
1.5 KiB
TypeScript
43 lines
1.5 KiB
TypeScript
import React from "react"
|
|
import type { MediaAsset } from "@/api/template-editor"
|
|
import { MATERIAL_TYPE_LABELS, MATERIAL_TYPE_ICONS } from "@/api/template-editor"
|
|
import { formatSize, formatDuration } from "./utils"
|
|
|
|
interface PreviewOverlayProps {
|
|
asset: MediaAsset
|
|
position: { x: number; y: number }
|
|
}
|
|
|
|
const PreviewOverlay: React.FC<PreviewOverlayProps> = ({ asset, position }) => {
|
|
return (
|
|
<div className="as-preview-overlay" style={{ left: position.x, top: position.y }}>
|
|
<div className="as-preview-overlay-thumb">
|
|
{asset.type === "video" && asset.source_url ? (
|
|
<video
|
|
src={asset.source_url}
|
|
autoPlay
|
|
muted
|
|
loop
|
|
playsInline
|
|
poster={asset.thumbnail_url}
|
|
/>
|
|
) : asset.thumbnail_url ? (
|
|
<img src={asset.thumbnail_url} alt={asset.name} />
|
|
) : (
|
|
<span className="as-preview-overlay-thumb-icon">{MATERIAL_TYPE_ICONS[asset.type]}</span>
|
|
)}
|
|
</div>
|
|
<p className="as-preview-overlay-name">{asset.name}</p>
|
|
<div className="as-preview-overlay-meta">
|
|
<span>类型: {MATERIAL_TYPE_LABELS[asset.type]}</span>
|
|
{asset.duration != null && <span>时长: {formatDuration(asset.duration)}</span>}
|
|
{asset.size != null && <span>大小: {formatSize(asset.size)}</span>}
|
|
{asset.quality_score != null && <span>质量分: {asset.quality_score}</span>}
|
|
{asset.tags.length > 0 && <span>标签: {asset.tags.join(", ")}</span>}
|
|
</div>
|
|
</div>
|
|
)
|
|
}
|
|
|
|
export default PreviewOverlay
|