UNPKG

@servicetitan/assist-ui

Version:

ServiceTitan Assist UI Components

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