Path: blob/1.0-develop/resources/scripts/components/elements/alert/Alert.tsx
10293 views
import { ExclamationIcon, ShieldExclamationIcon } from '@heroicons/react/outline';1import React from 'react';2import classNames from 'classnames';34interface AlertProps {5type: 'warning' | 'danger';6className?: string;7children: React.ReactNode;8}910export default ({ type, className, children }: AlertProps) => {11return (12<div13className={classNames(14'flex items-center border-l-8 text-gray-50 rounded-md shadow px-4 py-3',15{16['border-red-500 bg-red-500/25']: type === 'danger',17['border-yellow-500 bg-yellow-500/25']: type === 'warning',18},19className20)}21>22{type === 'danger' ? (23<ShieldExclamationIcon className={'w-6 h-6 text-red-400 mr-2'} />24) : (25<ExclamationIcon className={'w-6 h-6 text-yellow-500 mr-2'} />26)}27{children}28</div>29);30};313233