From 6f428b2297567e5f7447772ade4ae703d573180c Mon Sep 17 00:00:00 2001 From: BOHA Date: Sun, 7 Jun 2026 08:37:32 +0200 Subject: [PATCH] feat(mui): migrate AlertContainer off admin-* CSS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces framer-motion animation + custom SVG icons + admin-toast markup with MUI Snackbar + MUI Alert (filled variant). useAlertState() consumption (alerts array, removeAlert) is preserved verbatim — alert lifecycle (timing, types, auto-dismiss) is owned by AlertContext and unchanged. Alerts stack bottom-right with 72px vertical offset per slot. Co-Authored-By: Claude Opus 4.8 (1M context) --- src/admin/components/AlertContainer.tsx | 113 +++++------------------- 1 file changed, 20 insertions(+), 93 deletions(-) diff --git a/src/admin/components/AlertContainer.tsx b/src/admin/components/AlertContainer.tsx index fc1ea11..a4dc50b 100644 --- a/src/admin/components/AlertContainer.tsx +++ b/src/admin/components/AlertContainer.tsx @@ -1,102 +1,29 @@ -import React from "react"; -import { motion, AnimatePresence } from "framer-motion"; +import Snackbar from "@mui/material/Snackbar"; +import MuiAlert from "@mui/material/Alert"; import { useAlertState } from "../context/AlertContext"; -const icons: Record = { - success: ( - - - - - ), - error: ( - - - - - - ), - warning: ( - - - - - - ), - info: ( - - - - - - ), -}; - export default function AlertContainer() { const { alerts, removeAlert } = useAlertState(); return ( -
- - {alerts.map((alert) => ( - + {alerts.map((alert, index) => ( + + removeAlert(alert.id)} + variant="filled" + sx={{ width: "100%", minWidth: 280 }} > - {icons[alert.type]} - {alert.message} - - - ))} - -
+ {alert.message} + + + ))} + ); }