Components
WarningMessage Component
Components
- 3DCard Component
- AirpodsProLeft Component
- AirpodsProRight Component
- Alert Component
- Audio Component
- Button Component
- Card Component
- ChargingIconRight Component
- ChargingTextLeft Component
- Checkbox Component
- Collapse Component
- EmptyState Component
- ErrorMessage Component
- Form Component
- GridLayout Component
- HelpTooltip Component
- Image Component
- Input Component
- Lamp Component
- LightBox Component
- Modal Component
- MovingBorder Component
- PageLoading Component
- Popover Component
- PropertyDefault Component
- Radio Component
- RangeSlider Component
- Select
- SilentIconLeft Component
- SongThumbnail Component
- SilentTextRight Component
- Spinner Component
- TabButton Component
- TextArea Component
- Toggle Component
- Toggle2 Component
- Tooltip Component
- WarningMessage Component
Components
WarningMessage Component
WarningMessage
This component provides WarningMessage functionality.
Props
prop1
: Description of prop1.prop2
: Description of prop2.
Usage
import { WarningMessage } from './WarningMessage';
const props = {};
<WarningMessage prop1="value1" prop2="value2" />;
import type { FC, ReactNode } from 'react';
import cn from '../cn';
interface WarningMessageProps {
title?: string;
message?: ReactNode;
className?: string;
}
export const WarningMessage: FC<WarningMessageProps> = ({
title,
message,
className = ''
}) => {
if (!message) {
return null;
}
return (
<div
className={cn(
'space-y-1 rounded-xl border-2 border-yellow-500/50 bg-yellow-50 p-4 dark:bg-yellow-900/10',
className
)}
>
{title ? (
<h3 className="text-sm font-medium text-yellow-800 dark:text-yellow-200">
{title}
</h3>
) : null}
<div className="text-sm text-yellow-700 dark:text-yellow-200">
{message}
</div>
</div>
);
};
On this page