UNPKG

@servicetitan/assist-ui

Version:

ServiceTitan Atlas UI Components

36 lines (35 loc) 1.3 kB
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import classNames from 'classnames'; import { Button, Flex, Icon, Text } from '@servicetitan/anvil2'; import IconRefresh from '@servicetitan/anvil2/assets/icons/material/round/refresh.svg'; export const ErrorMessage = ({ error, message, onRetry, className })=>{ return /*#__PURE__*/ _jsxs(Flex, { className: classNames('m-inline-start-2', className), justifyContent: "space-between", children: [ /*#__PURE__*/ _jsx(Text, { size: "medium", className: classNames({ 'c-danger': error }), children: /*#__PURE__*/ _jsx("i", { children: error || message }) }), onRetry && /*#__PURE__*/ _jsxs(Button, { size: "small", appearance: "ghost", className: "m-inline-start-2", onClick: onRetry, children: [ "Retry", /*#__PURE__*/ _jsx(Icon, { svg: IconRefresh, size: "medium" }) ] }) ] }); }; //# sourceMappingURL=error-message.js.map