#272 fix:search spins forever in case of error (#302)

This commit is contained in:
lenhanphung
2025-11-14 19:28:05 +07:00
committed by GitHub
parent 1bc9b0c160
commit e8374cc2a1
5 changed files with 278 additions and 122 deletions
+8 -2
View File
@@ -1,14 +1,16 @@
import Alert from "@mui/material/Alert";
import Alert, { AlertColor } from "@mui/material/Alert";
import Snackbar from "@mui/material/Snackbar";
export function SnackbarAlert({
open,
setOpen,
message,
severity = "success",
}: {
open: boolean;
setOpen: Function;
message: string;
severity?: AlertColor;
}) {
return (
<Snackbar
@@ -17,7 +19,11 @@ export function SnackbarAlert({
onClose={() => setOpen(false)}
anchorOrigin={{ vertical: "bottom", horizontal: "center" }}
>
<Alert onClose={() => setOpen(false)} sx={{ width: "100%" }}>
<Alert
severity={severity}
onClose={() => setOpen(false)}
sx={{ width: "100%" }}
>
{message}
</Alert>
</Snackbar>