import { Component, ReactNode } from "react"; import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status"; import { TogglesInput } from "@Input/TogglesInput/TogglesInput"; import { ConfirmPopup } from "@Component/ConfirmPopup/ConfirmPopup"; import { ColorInput } from "@Input/ColorInput/ColorInput"; import { AttrInput } from "@Input/AttrInput/AttrInput"; import { Message } from "@Input/Message/Message"; import { Label } from "@Model/Label"; import "./LabelDetails.scss"; @useStatusWithEvent("focusLabelChange", "labelAttrChange", "labelChange") class LabelDetails extends Component { private renderFrom(label: Label) { return <> { if (this.props.status) { this.props.status.changeLabelAttrib(label, "name", value); } }}/> { if (this.props.status) { this.props.status.changeLabelAttrib(label, "color", color); } }}/> { if (this.props.status) { const status = this.props.status; status.popup.showPopup(ConfirmPopup, { infoI18n: "Popup.Delete.Objects.Confirm", titleI18N: "Popup.Action.Objects.Confirm.Title", yesI18n: "Popup.Action.Objects.Confirm.Delete", red: "yes", yes: () => { status.model.deleteLabel(label); status.setLabelObject(); } }) } }}/> ; } public render(): ReactNode { if (this.props.status) { if (this.props.status.focusLabel) { return this.renderFrom(this.props.status.focusLabel); } } return ; } } export { LabelDetails };