mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-21 13:18:04 +08:00
67165a78fc
* docs: live demo * chore: bump dumi * chore: fix lint * chore: fix lint * chore: update demo * chore: bump dumi * docs: enhance live demo * docs: update text
16 lines
411 B
TypeScript
16 lines
411 B
TypeScript
import type { FC } from 'react';
|
|
import React, { useContext } from 'react';
|
|
import { LiveContext } from 'dumi';
|
|
import { Alert, theme } from 'antd';
|
|
|
|
const LiveError: FC = () => {
|
|
const { error } = useContext(LiveContext);
|
|
const { token } = theme.useToken();
|
|
|
|
return error ? (
|
|
<Alert banner type="error" message={error} style={{ color: token.colorError }} />
|
|
) : null;
|
|
};
|
|
|
|
export default LiveError;
|