Files
NapCatQQ/packages/napcat-webui-frontend/src/components/toaster.tsx
Qiao ecbac2b782 fix(webui): 修复 Toast 提示信息过长导致 UI 溢出的问题 (#1595)
- 新增路径截断工具函数,支持 Windows/Linux 长路径处理

- 创建 toast 包装器,自动截断错误信息中的长路径

- 为 Toaster 组件添加 maxWidth 和 word-break 样式防止溢出

- 更新插件配置弹窗使用新的 toast 工具
2026-02-05 18:22:25 +08:00

24 lines
483 B
TypeScript

import { Toaster as HotToaster } from 'react-hot-toast';
import { useTheme } from '@/hooks/use-theme';
export const Toaster = () => {
const { isDark } = useTheme();
return (
<HotToaster
toastOptions={{
style: {
borderRadius: '20px',
background: isDark ? '#333' : '#fff',
color: isDark ? '#fff' : '#333',
maxWidth: '400px',
wordBreak: 'break-word',
},
}}
/>
);
};
export default Toaster;