mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-30 12:28:33 +08:00
b966162d64
* docs: update live demo feature * docs: real iframe live demo
14 lines
359 B
TypeScript
14 lines
359 B
TypeScript
import type { FC } from 'react';
|
|
import React from 'react';
|
|
import { Alert, theme } from 'antd';
|
|
|
|
const LiveError: FC<{ error: Error | null }> = ({ error }) => {
|
|
const { token } = theme.useToken();
|
|
|
|
return error ? (
|
|
<Alert banner type="error" message={error.toString()} style={{ color: token.colorError }} />
|
|
) : null;
|
|
};
|
|
|
|
export default LiveError;
|