@servicetitan/assist-ui
Version:
ServiceTitan Assist UI Components
8 lines • 1.55 kB
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { Button, Card, Flex, Icon, Radio, RadioGroup, Text } from '@servicetitan/anvil2';
import IconTitanIntelligence from '@servicetitan/anvil2/assets/icons/st/titan_intelligence.svg';
import { core } from '@servicetitan/anvil2/token';
export const SystemMessage = ({ message, radioOptions, onRadioChange, buttonText, onSubmit, buttonDisabled = false, }) => {
return (_jsxs(Flex, { direction: "column", children: [_jsxs(Flex, { children: [_jsx("span", { className: "m-inline-end-2", style: { color: core.semantic.ForegroundColorPrimary.value }, children: _jsx(Icon, { svg: IconTitanIntelligence, size: "large", inherit: true }) }), _jsx(Text, { inline: true, children: _jsx("b", { children: "Assist" }) })] }), _jsx(Text, { size: "medium", children: message }), _jsx(Card, { children: _jsxs(Flex, { direction: "column", gap: 2, children: [_jsx(RadioGroup, { onChange: e => onRadioChange(e.target.value), children: radioOptions.map(option => (_jsx(Radio, { name: "action", value: option.value, label: _jsxs(Flex, { direction: "column", gap: "0", grow: 1, children: [_jsx(Text, { children: _jsx("b", { children: option.label }) }), option.description && (_jsx(Text, { subdued: true, size: "small", children: option.description }))] }) }, option.value))) }), _jsx(Button, { appearance: "primary", style: { width: '100%' }, className: "m-inline-start-auto", onClick: onSubmit, disabled: buttonDisabled, children: buttonText })] }) })] }));
};
//# sourceMappingURL=system-message.js.map