mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Add comments pagination, login and register pages
This commit is contained in:
32
components/ui/alerts/ErrorAlert.tsx
Normal file
32
components/ui/alerts/ErrorAlert.tsx
Normal file
@@ -0,0 +1,32 @@
|
||||
import { Dispatch, FC, SetStateAction } from 'react';
|
||||
import { FiAlertTriangle } from 'react-icons/fi';
|
||||
|
||||
interface ErrorAlertProps {
|
||||
error: string;
|
||||
setError: Dispatch<SetStateAction<string>>;
|
||||
}
|
||||
|
||||
const ErrorAlert: FC<ErrorAlertProps> = ({ error, setError }) => {
|
||||
return (
|
||||
<div className="alert alert-error shadow-lg">
|
||||
<div>
|
||||
<FiAlertTriangle className="h-6 w-6" />
|
||||
<span>{error}</span>
|
||||
</div>
|
||||
|
||||
<div className="flex-none">
|
||||
<button
|
||||
className="btn-ghost btn-sm btn"
|
||||
type="button"
|
||||
onClick={() => {
|
||||
setError('');
|
||||
}}
|
||||
>
|
||||
OK
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ErrorAlert;
|
||||
Reference in New Issue
Block a user