@servicetitan/assist-ui
Version:
ServiceTitan Atlas UI Components
60 lines (59 loc) • 2.47 kB
JavaScript
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 UserMessage = ({ message, className, isError = false, onRetry })=>{
return /*#__PURE__*/ _jsxs(Flex, {
direction: "column",
alignItems: "flex-end",
className: className,
children: [
/*#__PURE__*/ _jsx(Text, {
size: "small",
subdued: isError,
className: classNames('bg-stronger', {
'bg-danger-stronger': isError
}),
alignItems: "flex-start",
style: {
padding: '8px 12px 8px 16px',
borderRadius: '24px 24px 0px 24px',
boxSizing: 'border-box',
color: 'var(--foreground-color, #141414)',
fontFamily: "var(--typography-paragraph-font-family, 'Nunito Sans')",
fontSize: 'var(--typography-paragraph-size-default, 16px)',
fontWeight: '400',
lineHeight: 'var(--typography-paragraph-line-height-default, 24px)'
},
children: message
}),
isError && /*#__PURE__*/ _jsxs(Flex, {
className: "m-inline-start-2",
justifyContent: "flex-end",
alignItems: "center",
children: [
/*#__PURE__*/ _jsx(Text, {
variant: "body",
size: "small",
className: "c-danger",
children: "Message not delivered"
}),
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=user-message.js.map