UNPKG

@veecode-platform/plugin-kong-service-manager

Version:

58 lines (55 loc) 1.71 kB
import { Box, Typography } from '@material-ui/core'; import React from 'react'; import { useFeedbackComponentStyles } from './styles.esm.js'; import Lottie from 'react-lottie'; import successAnimationData from './assets/success.json.esm.js'; import errorAnimationData from './assets/error.json.esm.js'; const SuccessAnimation = () => { const defaultOptions = { loop: false, autoplay: true, animationData: successAnimationData, rendererSettings: { preserveAspectRatio: "xMidYMid slice" } }; return /* @__PURE__ */ React.createElement( Lottie, { options: defaultOptions, height: 180, width: 180 } ); }; const ErrorAnimation = () => { const defaultOptions = { loop: false, autoplay: true, animationData: errorAnimationData, rendererSettings: { preserveAspectRatio: "xMidYMid slice" } }; return /* @__PURE__ */ React.createElement( Lottie, { options: defaultOptions, height: 90, width: 90 } ); }; const FeedbackComponent = (props) => { const { variant, message } = props; const { root, content, animation } = useFeedbackComponentStyles(); return /* @__PURE__ */ React.createElement( Box, { className: root }, /* @__PURE__ */ React.createElement("div", { className: content }, /* @__PURE__ */ React.createElement("div", { className: animation }, variant === "success" ? /* @__PURE__ */ React.createElement(SuccessAnimation, null) : /* @__PURE__ */ React.createElement(ErrorAnimation, null)), /* @__PURE__ */ React.createElement(Typography, { variant: "h6" }, message)) ); }; export { FeedbackComponent }; //# sourceMappingURL=FeedbackComponent.esm.js.map