-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathalerts.tsx
More file actions
35 lines (33 loc) · 1.05 KB
/
alerts.tsx
File metadata and controls
35 lines (33 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { CheckCircleIcon, XCircleIcon } from '@heroicons/react/solid'
import { ReactNode } from 'react'
export function Alert({ children }: { children: ReactNode }) {
return (
<div className="bg-green-50 border-l-4 border-green-400 py-3 px-4 mt-4">
<div className="flex">
<div className="flex-shrink-0">
<CheckCircleIcon
className="h-5 w-5 text-green-400"
aria-hidden="true"
/>
</div>
<div className="ml-3">
<p className="text-sm font-medium text-green-900">{children}</p>
</div>
</div>
</div>
)
}
export function ErrorAlert({ children }: { children: ReactNode }) {
return (
<div className="bg-red-50 border-l-4 border-red-400 py-3 px-4 mt-4">
<div className="flex">
<div className="flex-shrink-0">
<XCircleIcon className="h-5 w-5 text-red-400" aria-hidden="true" />
</div>
<div className="ml-3">
<p className="text-sm font-medium text-red-900">{children}</p>
</div>
</div>
</div>
)
}