one-api/web/berry/src/constants/SnackbarConstants.js
Buer 07b2fd58d6
feat: berry theme update & bug fix (#1471)
* feat: load channel models from server

* chore: support AWS Claude/Cloudflare/Coze

* fix: Popup message when copying fails

* chore: Optimize tips
2024-05-28 01:22:40 +08:00

60 lines
1.2 KiB
JavaScript

import { closeSnackbar } from 'notistack';
import { IconX } from '@tabler/icons-react';
import { IconButton } from '@mui/material';
const action = (snackbarId) => (
<>
<IconButton
onClick={() => {
closeSnackbar(snackbarId);
}}
>
<IconX stroke={1.5} size="1.25rem" />
</IconButton>
</>
);
export const snackbarConstants = {
Common: {
ERROR: {
variant: 'error',
autoHideDuration: 5000,
preventDuplicate: true,
action
},
WARNING: {
variant: 'warning',
autoHideDuration: 10000,
preventDuplicate: true,
action
},
SUCCESS: {
variant: 'success',
autoHideDuration: 1500,
preventDuplicate: true,
action
},
INFO: {
variant: 'info',
autoHideDuration: 3000,
preventDuplicate: true,
action
},
NOTICE: {
variant: 'info',
autoHideDuration: 20000,
preventDuplicate: true,
action
},
COPY: {
variant: 'copy',
persist: true,
preventDuplicate: true,
allowDownload: true,
action
}
},
Mobile: {
anchorOrigin: { vertical: 'bottom', horizontal: 'center' }
}
};