Files
xiaoxia-saas/apps/web/src/pages/editing-planner/components/PipConfigPanel.tsx
T
xiaoxia 64387c00bb
CI/CD Pipeline / ACR Image Cleanup (push) Failing after 1247h21m43s
CI/CD Pipeline / Staging API Integration Tests (push) Failing after 1247h21m43s
CI/CD Pipeline / Staging E2E Tests (push) Failing after 1247h21m44s
CI/CD Pipeline / Deploy Staging (Watchtower auto-deploy) (push) Failing after 1247h27m46s
CI/CD Pipeline / Production Browser E2E (push) Failing after 1247h33m44s
CI/CD Pipeline / Deploy Production (push) Failing after 1247h40m40s
CI/CD Pipeline / Build Production Worker Image (push) Failing after 1247h46m28s
CI/CD Pipeline / Build Production API Image (push) Failing after 1247h46m32s
CI/CD Pipeline / PR Build Worker Image (push) Failing after 1247h48m13s
CI/CD Pipeline / Check if frontend-only change (push) Failing after 1247h48m17s
CI/CD Pipeline / PR Build Web Image (push) Failing after 1247h48m15s
CI/CD Pipeline / Validate - Code Quality (push) Failing after 2m17s
CI/CD Pipeline / Validate - Type Check (mypy) (push) Successful in 1m54s
CI/CD Pipeline / Validate - Migration (alembic) (push) Successful in 1m43s
CI/CD Pipeline / Unit Tests (push) Failing after 1h6m19s
CI/CD Pipeline / Integration Tests (push) Successful in 2m26s
CI/CD Pipeline / Frontend Lint (push) Failing after 36s
CI/CD Pipeline / Frontend Unit Tests (push) Successful in 1m10s
CI/CD Pipeline / Build Production Web Image (push) Failing after 1248h19m9s
CI/CD Pipeline / PR Build API Image (push) Failing after 1248h20m54s
CI/CD Pipeline / Build Staging API Image (push) Successful in 15m48s
CI/CD Pipeline / Build Staging Web Image (push) Failing after 3m10s
CI/CD Pipeline / Build Staging Worker Image (push) Successful in 6m8s
CI/CD Pipeline / Canary Release to Production (push) Has been cancelled
refactor(editing-planner): Phase 2 - 重构9个面板组件 (#928)
2026-07-26 15:38:18 +08:00

92 lines
2.4 KiB
TypeScript

/**
* 混剪配置面板 — Drawer 形式
* 左侧图层列表 + 右侧单图层配置 + 迷你预览区
*/
import React from "react"
import { Drawer, Switch } from "antd"
import type { PipConfig } from "@/pages/editing-planner/types"
import LayerList from "./pip-config/LayerList"
import LayerConfig from "./pip-config/LayerConfig"
import { usePipLayers } from "@/pages/editing-planner/hooks/usePipLayers"
interface PipConfigPanelProps {
open: boolean
onClose: () => void
config: PipConfig
onChange: (config: PipConfig) => void
totalDuration: number
}
const PipConfigPanel: React.FC<PipConfigPanelProps> = ({
open,
onClose,
config,
onChange,
totalDuration,
}) => {
const {
selectedId,
setSelectedId,
selectedLayer,
handleAddLayer,
handleDeleteLayer,
updateLayer,
handleEnableToggle,
handleReset,
handleGridClick,
handleWidthChange,
handleHeightChange,
} = usePipLayers({ config, onChange })
return (
<Drawer
title="🖼️ 混剪设置"
placement="right"
width={520}
open={open}
onClose={onClose}
className="pip-config-panel-drawer"
>
{/* ═══ 顶部工具栏 ═══ */}
<div className="pip-toolbar">
<div className="pip-toolbar-left">
<span style={{ fontSize: 13, color: "#666" }}>共 {config.layers.length} 个图层</span>
</div>
<div className="pip-enable-switch">
<span>启用</span>
<Switch size="small" checked={config.enabled} onChange={handleEnableToggle} />
</div>
</div>
{/* ═══ 主体:图层列表 + 配置区 ═══ */}
<div className="pip-body">
<LayerList
layers={config.layers}
selectedId={selectedId}
onSelect={setSelectedId}
onAdd={handleAddLayer}
onDelete={handleDeleteLayer}
/>
<LayerConfig
layer={selectedLayer}
layers={config.layers}
totalDuration={totalDuration}
onUpdate={updateLayer}
onGridClick={handleGridClick}
onWidthChange={handleWidthChange}
onHeightChange={handleHeightChange}
/>
</div>
{/* ── 底部操作 ── */}
<div className="pip-footer">
<button className="pip-reset-btn" onClick={handleReset}>
重置
</button>
</div>
</Drawer>
)
}
export default PipConfigPanel