import type { ThemeProps } from "../../types"; import logo from "../../assets/icon.png"; import "./eco.css"; export default function EcoTheme({ config, state }: ThemeProps) { const { step, progress, installPath } = state; const { texts, primaryColor } = config; const getStatusText = () => { for (let i = texts.progressFrames.length - 1; i >= 0; i--) { if (progress <= texts.progressFrames[i].limit) return texts.progressFrames[i].text; } return texts.progressFrames[texts.progressFrames.length - 1]?.text ?? ""; }; const cssVars: React.CSSProperties = { // @ts-expect-error "--eco-primary": primaryColor || "#4CAF50", }; return (
{/* 背景自然元素点缀 */}
Logo {config.appDisplayName}
{step === 1 && (

{texts.welcomeTitle}

{texts.welcomeSubtitle}

{installPath}
Tap to change
{texts.licenseAgreement}
)} {step === 2 && (
{/* 使用有机的圆角形状作为进度掩码 */}
{progress}%
{getStatusText()}
)} {step === 3 && (

{texts.successTitle}

{texts.successSubtitle}

{texts.features.map(f => ( {f.label} ))}
)}
); }