mirror of
https://github.com/songquanpeng/one-api.git
synced 2025-11-17 13:43:42 +08:00
fix: copy fails in http environment (#43)
* 🐛 fix: copy fails in http environment * 🎨 optimize: web UI
This commit is contained in:
33
web/src/ui-component/Snackbar.js
Normal file
33
web/src/ui-component/Snackbar.js
Normal file
@@ -0,0 +1,33 @@
|
||||
import PropTypes from 'prop-types';
|
||||
import { forwardRef } from 'react';
|
||||
import { SnackbarContent, useSnackbar } from 'notistack';
|
||||
import { Alert } from '@mui/material';
|
||||
|
||||
const CopySnackbar = forwardRef((props, ref) => {
|
||||
const { closeSnackbar } = useSnackbar();
|
||||
|
||||
return (
|
||||
<SnackbarContent ref={ref}>
|
||||
<Alert
|
||||
severity="info"
|
||||
variant="filled"
|
||||
sx={{ width: '100%', whiteSpace: 'normal', overflowWrap: 'break-word' }}
|
||||
onClose={() => {
|
||||
closeSnackbar(props.id);
|
||||
}}
|
||||
>
|
||||
{props.message}
|
||||
</Alert>
|
||||
</SnackbarContent>
|
||||
);
|
||||
});
|
||||
|
||||
CopySnackbar.displayName = 'ReportComplete';
|
||||
|
||||
CopySnackbar.propTypes = {
|
||||
props: PropTypes.object,
|
||||
id: PropTypes.number.isRequired, // 添加 id 的验证
|
||||
message: PropTypes.any.isRequired // 添加 message 的验证
|
||||
};
|
||||
|
||||
export default CopySnackbar;
|
||||
@@ -33,7 +33,7 @@ import { Box, Avatar } from '@mui/material';
|
||||
import { alpha } from '@mui/material/styles';
|
||||
import Card from '@mui/material/Card';
|
||||
import shapeAvatar from 'assets/images/icons/shape-avatar.svg';
|
||||
import coverAvatar from 'assets/images/invite/cover.jpg';
|
||||
import coverAvatar from 'assets/images/invite/cover.webp';
|
||||
import userAvatar from 'assets/images/users/user-round.svg';
|
||||
import SvgColor from 'ui-component/SvgColor';
|
||||
|
||||
|
||||
Reference in New Issue
Block a user