@servicetitan/assist-ui
Version:
ServiceTitan Atlas UI Components
71 lines (70 loc) • 2.98 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Button, Flex, Icon, Text } from '@servicetitan/anvil2';
import IconAtlasLogo from '@servicetitan/anvil2/assets/icons/st/atlas_logo.svg';
import { core } from '@servicetitan/anvil2/token';
export const SmallAction = ({ recommendationId, message, description, onReject, onAccept, buttonDisabled = false, className })=>{
return /*#__PURE__*/ _jsxs(Flex, {
direction: "column",
className: className,
children: [
/*#__PURE__*/ _jsxs(Flex, {
children: [
/*#__PURE__*/ _jsx("span", {
className: "m-inline-end-1",
style: {
color: core.semantic.ForegroundColorPrimary.value
},
children: /*#__PURE__*/ _jsx(Icon, {
svg: IconAtlasLogo,
size: "large",
inherit: true
})
}),
/*#__PURE__*/ _jsx(Text, {
inline: true,
children: /*#__PURE__*/ _jsx("b", {
children: "Atlas"
})
})
]
}),
/*#__PURE__*/ _jsxs(Flex, {
direction: "column",
children: [
/*#__PURE__*/ _jsx(Text, {
size: "medium",
children: message
}),
description && /*#__PURE__*/ _jsx(Text, {
size: "small",
children: description
}),
/*#__PURE__*/ _jsxs(Flex, {
alignItems: "flex-start",
gap: 1,
children: [
/*#__PURE__*/ _jsx(Button, {
appearance: "ghost",
className: "m-inline-start-auto",
onClick: ()=>onReject(recommendationId),
disabled: buttonDisabled,
children: "Reject"
}),
/*#__PURE__*/ _jsx(Button, {
appearance: "primary",
style: {
width: '50%'
},
className: "m-inline-start-auto",
onClick: ()=>onAccept(recommendationId),
disabled: buttonDisabled,
children: "Accept"
})
]
})
]
})
]
});
};
//# sourceMappingURL=small-action.js.map