Spaces:
Build error
Build error
Download components/AlertContainer.jsx from ActuallyCookie/anycoder-6a1e4b3a: direct link, hf CLI and curl.
- Browser
- Download file 1.03 kB
-
https://huggingface.co/spaces/ActuallyCookie/anycoder-6a1e4b3a/resolve/main/components/AlertContainer.jsx
- Command line
-
hf download hf://spaces/ActuallyCookie/anycoder-6a1e4b3a/components/AlertContainer.jsx
-
curl -L -o AlertContainer.jsx https://huggingface.co/spaces/ActuallyCookie/anycoder-6a1e4b3a/resolve/main/components/AlertContainer.jsx
1.03 kB
| import { AnimatePresence } from 'framer-motion'; | |
| import AlertCard from './AlertCard'; | |
| const containerPositions = { | |
| 'top-left': 'fixed top-6 left-6 z-[9999]', | |
| 'top-center': 'fixed top-6 left-1/2 -translate-x-1/2 z-[9999]', | |
| 'top-right': 'fixed top-6 right-6 z-[9999]', | |
| 'bottom-left': 'fixed bottom-6 left-6 z-[9999]', | |
| 'bottom-center': 'fixed bottom-6 left-1/2 -translate-x-1/2 z-[9999]', | |
| 'bottom-right': 'fixed bottom-6 right-6 z-[9999]', | |
| 'center': 'fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 z-[9999]', | |
| }; | |
| export default function AlertContainer({ alerts, position, onDismiss }) { | |
| return ( | |
| <div className={`${containerPositions[position] || containerPositions['top-right']} flex flex-col gap-3 w-full max-w-sm`}> | |
| <AnimatePresence mode="popLayout"> | |
| {alerts.map((alert) => ( | |
| <AlertCard | |
| key={alert.id} | |
| {...alert} | |
| position={position} | |
| onDismiss={onDismiss} | |
| /> | |
| ))} | |
| </AnimatePresence> | |
| </div> | |
| ); | |
| } |