refactor: repartition server-side and client-side code

This commit is contained in:
LIlGG
2025-10-11 18:26:07 +08:00
parent 7acc4949fb
commit e9b573a276
309 changed files with 631 additions and 962 deletions

View File

@@ -0,0 +1,23 @@
import { memo, useEffect, useState } from 'react';
import { IconButton } from '~/.client/components/ui/IconButton';
import { toggleSidebar } from '~/.client/stores/sidebar';
interface HistorySwitchProps {
className?: string;
}
export const HistorySwitch = memo(({ className }: HistorySwitchProps) => {
const [domLoaded, setDomLoaded] = useState(false);
useEffect(() => {
setDomLoaded(true);
}, []);
return (
domLoaded && (
<IconButton className={className} title="查看历史" onClick={toggleSidebar}>
<div className="i-mingcute:history-line text-xl"></div>
</IconButton>
)
);
});