perf: ai param config (#3451)

* perf: ai param config

* pacakge import

* perf: ai config doc
This commit is contained in:
Archer
2024-12-23 10:31:15 +08:00
committed by GitHub
parent ae149069bf
commit 58fbf78c6e
19 changed files with 287 additions and 172 deletions

View File

@@ -25,18 +25,20 @@ const SystemStoreContextProvider = ({
children: ReactNode;
device?: 'pc' | 'mobile' | null;
}) => {
const [isPc] = useMediaQuery('(min-width: 900px)');
const [isPc] = useMediaQuery('(min-width: 900px)', {
fallback: device === 'pc'
});
useEffect(() => {
setSize(isPc ? 'pc' : 'mobile');
}, [isPc]);
const contextValue = useMemo(
() => ({
isPc: device ? device === 'pc' : isPc
isPc
}),
[device, isPc]
[isPc]
);
return (
<useSystemStoreContext.Provider value={contextValue}>{children}</useSystemStoreContext.Provider>
);