All checks were successful
ci/woodpecker/push/woodpecker Pipeline was successful
AssetsModule 等引用 src/components/Blur 但该文件未纳入版本库导致 CI rollup 报 Could not resolve "../../components/Blur"。 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
18 lines
604 B
TypeScript
18 lines
604 B
TypeScript
import { createContext, useContext, type ReactNode } from 'react';
|
|
|
|
const DemoModeContext = createContext(false);
|
|
|
|
export function DemoModeProvider({ enabled, children }: { enabled: boolean; children: ReactNode }) {
|
|
return <DemoModeContext.Provider value={enabled}>{children}</DemoModeContext.Provider>;
|
|
}
|
|
|
|
export function useDemoMode() {
|
|
return useContext(DemoModeContext);
|
|
}
|
|
|
|
export default function Blur({ children }: { children: ReactNode }) {
|
|
const demo = useContext(DemoModeContext);
|
|
if (!demo) return <>{children}</>;
|
|
return <span className="blur-[5px] select-none">{children}</span>;
|
|
}
|