feat(web-platform): release V0.9.3 全模块界面重构
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled

This commit is contained in:
2026-09-08 17:57:57 +08:00
parent 831d0b95bb
commit 13e35be98b
124 changed files with 5182 additions and 2141 deletions
@@ -0,0 +1,64 @@
import { Pause, Play, RotateCcw, StepForward } from 'lucide-react';
import { Button, IconButton, Select } from '../../components/ui';
export function SimulationControls({
paused,
ready,
speed,
loading,
onTogglePause,
onStep,
onReset,
onSpeed,
}: {
paused: boolean;
ready: boolean;
speed: number;
loading: boolean;
onTogglePause: () => void;
onStep: () => void;
onReset: () => void;
onSpeed: (speed: number) => void;
}) {
return (
<div aria-label="仿真控制" className="flex flex-wrap items-center justify-center gap-1">
<Button
variant="ghost"
onClick={onTogglePause}
disabled={!ready}
aria-label={paused ? '▶ 播放' : '⏸ 暂停'}
icon={paused ? <Play className="h-3.5 w-3.5" /> : <Pause className="h-3.5 w-3.5" />}
>
{paused ? '播放' : '暂停'}
</Button>
<IconButton
tooltip="单步(暂停时可用)"
aria-label="单步"
onClick={onStep}
disabled={!ready || !paused}
>
<StepForward className="h-3.5 w-3.5" />
</IconButton>
<IconButton
tooltip="重置仿真(R;地图编辑时 R 为缩放)"
aria-label="重置"
onClick={onReset}
disabled={!ready}
>
<RotateCcw className="h-3.5 w-3.5" />
</IconButton>
<Select
aria-label="仿真速度"
value={speed}
disabled={loading}
onChange={(event) => onSpeed(Number(event.target.value))}
className="w-[70px]"
>
<option value={0.25}>0.25×</option>
<option value={0.5}>0.5×</option>
<option value={1}>1×</option>
<option value={2}>2×</option>
<option value={4}>4×</option>
</Select>
</div>
);
}