Files
AFFiNE/packages/frontend/component/src/ui/error-message/error-message.tsx
T
2024-04-17 15:09:09 +08:00

29 lines
544 B
TypeScript

import clsx from 'clsx';
import type React from 'react';
import { errorMessage } from './style.css';
export const ErrorMessage = ({
children,
inline,
style,
className,
}: React.PropsWithChildren<{
inline?: boolean;
style?: React.CSSProperties;
className?: string;
}>) => {
if (inline) {
return (
<span style={style} className={clsx(className, errorMessage)}>
{children}
</span>
);
}
return (
<div style={style} className={clsx(className, errorMessage)}>
{children}
</div>
);
};