import { Collapsible, TypeScriptUtils, } from "@dndbeyond/character-components/es"; import { HtmlSelectOption, RuleDataUtils, } from "@dndbeyond/character-rules-engine/es"; import CurrencyPaneSelectEditor from "../../../Shared/containers/panes/CurrencyPane/CurrencyPaneSelectEditor"; const Lifestyle = ({ lifestyle, ruleData, isReadonly, handleLifestyleUpdate, }) => { const lifestyleData = RuleDataUtils.getLifestyles(ruleData); const lifestyleOptions: Array = lifestyleData .map((lifestyle) => { if (lifestyle.id === null) { return null; } return { label: `${lifestyle.name} ${ lifestyle.cost === "-" ? "" : `(${lifestyle.cost})` }`, value: lifestyle.id, }; }) .filter(TypeScriptUtils.isNotNullOrUndefined); let lifestyleDescriptionNode: React.ReactNode; if (lifestyle !== null) { lifestyleDescriptionNode = lifestyle.description; } return (
{lifestyleDescriptionNode && ( {lifestyle?.name ?? "Lifestyle"} Details } layoutType="minimal" >
{lifestyleDescriptionNode}
)}
); }; export default Lifestyle;