import { Component, ReactNode } from "react"; import { AttrInput } from "@Component/AttrInput/AttrInput"; import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status"; import { Message } from "@Component/Message/Message"; import { ColorInput } from "@Component/ColorInput/ColorInput"; import { Label } from "@Model/Label"; import { TogglesInput } from "@Component/TogglesInput/TogglesInput"; 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) { this.props.status.model.deleteLabel(label); this.props.status.setLabelObject(); } }}/> ; } public render(): ReactNode { if (this.props.status) { if (this.props.status.focusLabel) { return this.renderFrom(this.props.status.focusLabel); } } return ; } } export { LabelDetails };