forked from pterodactyl/panel
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAlert.tsx
More file actions
31 lines (29 loc) · 993 Bytes
/
Alert.tsx
File metadata and controls
31 lines (29 loc) · 993 Bytes
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
import { ExclamationIcon, ShieldExclamationIcon } from '@heroicons/react/outline';
import React from 'react';
import classNames from 'classnames';
interface AlertProps {
type: 'warning' | 'danger';
className?: string;
children: React.ReactNode;
}
export default ({ type, className, children }: AlertProps) => {
return (
<div
className={classNames(
'flex items-center border-l-8 text-gray-50 rounded-md shadow px-4 py-3',
{
['border-red-500 bg-red-500/25']: type === 'danger',
['border-yellow-500 bg-yellow-500/25']: type === 'warning',
},
className
)}
>
{type === 'danger' ? (
<ShieldExclamationIcon className={'w-6 h-6 text-red-400 mr-2'} />
) : (
<ExclamationIcon className={'w-6 h-6 text-yellow-500 mr-2'} />
)}
{children}
</div>
);
};