Add behavior details panel
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
import { Component, ReactNode} from "react";
|
||||
import { useStatusWithEvent, IMixinStatusProps } from "@Context/Status";
|
||||
import { Behavior } from "@Model/Behavior";
|
||||
import { Message } from "@Component/Message/Message";
|
||||
import "./BehaviorDetails.scss";
|
||||
|
||||
interface IBehaviorDetailsProps {}
|
||||
|
||||
@useStatusWithEvent("focusBehaviorChange")
|
||||
class BehaviorDetails extends Component<IBehaviorDetailsProps & IMixinStatusProps> {
|
||||
|
||||
private renderFrom(behavior: Behavior): ReactNode {
|
||||
return <></>;
|
||||
}
|
||||
|
||||
public render(): ReactNode {
|
||||
if (this.props.status) {
|
||||
if (this.props.status.focusBehavior) {
|
||||
return this.renderFrom(this.props.status.focusBehavior);
|
||||
}
|
||||
}
|
||||
return <Message i18nKey="Panel.Info.Behavior.Details.Error.Not.Behavior"/>;
|
||||
}
|
||||
}
|
||||
|
||||
export { BehaviorDetails };
|
||||
@@ -9,6 +9,7 @@ import { LabelList } from "./LabelList/LabelList";
|
||||
import { LabelDetails } from "./LabelDetails/LabelDetails";
|
||||
import { GroupDetails } from "./GroupDetails/GroupDetails";
|
||||
import { BehaviorList } from "./BehaviorList/BehaviorList";
|
||||
import { BehaviorDetails } from "./BehaviorDetails/BehaviorDetails";
|
||||
|
||||
interface IPanelInfo {
|
||||
nameKey: string;
|
||||
@@ -29,6 +30,7 @@ type PanelId = ""
|
||||
| "LabelDetails" // 标签属性
|
||||
| "GroupDetails" // 群属性
|
||||
| "BehaviorList" // 行为列表
|
||||
| "BehaviorDetails" // 行为属性
|
||||
;
|
||||
|
||||
const PanelInfoMap = new Map<PanelId, IPanelInfo>();
|
||||
@@ -60,6 +62,10 @@ PanelInfoMap.set("BehaviorList", {
|
||||
nameKey: "Panel.Title.Behavior.List.View", introKay: "Panel.Info.Behavior.List.View",
|
||||
class: BehaviorList, hidePadding: true
|
||||
});
|
||||
PanelInfoMap.set("BehaviorDetails", {
|
||||
nameKey: "Panel.Title.Behavior.Details.View", introKay: "Panel.Info.Behavior.Details.View",
|
||||
class: BehaviorDetails
|
||||
});
|
||||
|
||||
function getPanelById(panelId: PanelId): ReactNode {
|
||||
switch (panelId) {
|
||||
|
||||
Reference in New Issue
Block a user