2024-01-06 15:17:04 -05:00
|
|
|
import React, { useState } from "react";
|
|
|
|
import { FaExclamationTriangle } from "react-icons/fa";
|
2024-08-25 17:35:46 -04:00
|
|
|
import { Button } from "@/components/ui/button";
|
2024-01-06 15:17:04 -05:00
|
|
|
import { X } from "lucide-react";
|
|
|
|
|
|
|
|
|
|
|
|
interface NoticeProps {
|
|
|
|
message: string
|
|
|
|
hidden?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
const ErrorNotice = ({
|
|
|
|
message,
|
|
|
|
hidden = false
|
|
|
|
} : NoticeProps ) => {
|
|
|
|
const [open, setOpen] = useState(true)
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={"flex flex-col bg-red-400 rounded-lg px-4 py-2 mx-6" + (hidden || !open ? " hidden" : "")}>
|
|
|
|
<div className="ml-[10px] items-center align-middle text-start w-full flex flex-row justify-between">
|
|
|
|
<div>
|
|
|
|
<FaExclamationTriangle className="w-3 h-3 inline-block" />
|
|
|
|
<div className="ml-2 inline-block text-md align-middle font-bold">Info</div>
|
|
|
|
</div>
|
|
|
|
<Button variant="ghost" onClick={() => setOpen(false)} className="hover:bg-red-800 rounded-lg">
|
|
|
|
<X className="align-top items-end" />
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
<div>
|
|
|
|
<p className="text-sm flex flex-grow w-full">{message}</p>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
export default ErrorNotice;
|