Skip to content

Commit

Permalink
TypeScript AttackBox
Browse files Browse the repository at this point in the history
  • Loading branch information
gsproston-scottlogic committed Aug 8, 2023
1 parent d37e400 commit 7a58cb2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import { AttackInfo } from "../../models/attack";
import "../StrategyBox/StrategyMechanism.css";
import React from "react";

function DefenceMechanism(props) {
function DefenceMechanism({ attack }: { attack: AttackInfo }) {
const [isInfoBoxVisible, setIsInfoBoxVisible] = React.useState(false);

return (
<span>
<div className="strategy-mechanism">
<div className="strategy-mechanism-header">
<span>{props.attack.name}</span>
<span>{attack.name}</span>
<span
className="strategy-mechanism-info"
onMouseOver={() => {
Expand All @@ -22,7 +23,7 @@ function DefenceMechanism(props) {
</span>
</div>
{isInfoBoxVisible ? (
<div className="strategy-mechanism-info-box">{props.attack.info}</div>
<div className="strategy-mechanism-info-box">{attack.info}</div>
) : null}
</div>
</span>
Expand Down

0 comments on commit 7a58cb2

Please sign in to comment.