11import React , { useContext } from "react" ;
22import { WidgetActions , executeActions } from "../widgetActions" ;
3- import { commonCss , Widget } from "../widget" ;
3+ import { Widget } from "../widget" ;
44import { PVComponent , PVWidgetPropType } from "../widgetProps" ;
55import classes from "./actionButton.module.css" ;
66import { registerWidget } from "../register" ;
@@ -15,7 +15,7 @@ import {
1515} from "../propTypes" ;
1616import { Color } from "../../../types/color" ;
1717import { Font } from "../../../types/font" ;
18- import { Border , BorderStyle } from "../../../types/border" ;
18+ import { Border } from "../../../types/border" ;
1919import { MacroContext } from "../../../types/macros" ;
2020import { ExitFileContext , FileContext } from "../../../misc/fileContext" ;
2121import { Button } from "@mui/material" ;
@@ -43,7 +43,8 @@ const ActionButtonPropType = {
4343 foregroundColor : ColorPropOpt ,
4444 font : FontPropOpt ,
4545 border : BorderPropOpt ,
46- visible : BoolPropOpt
46+ visible : BoolPropOpt ,
47+ disabled : BoolPropOpt
4748} ;
4849
4950const ActionButtonWidgetProps = {
@@ -72,12 +73,14 @@ export const ActionButtonWidget = (
7273 < ThemeProvider theme = { defaultColours } >
7374 < Button
7475 variant = "contained"
76+ disabled = { props . disabled }
7577 sx = { {
7678 height : "100%" ,
7779 width : "100%" ,
7880 fontFamily : props . font ?. css ( ) ?? "" ,
7981 color : props . foregroundColor ?. toString ( ) ?? defaultColours . palette . primary . contrastText ,
8082 backgroundColor : props . backgroundColor ?. toString ( ) ?? defaultColours . palette . primary . main ,
83+ border : props . border ?. css ( ) ?? ""
8184 } }
8285 onClick = { onClick }
8386 >
@@ -91,7 +94,7 @@ export const ActionButtonWidget = (
9194 < figcaption > { props . text } </ figcaption >
9295 </ figure >
9396 ) : (
94- props . text ?? ""
97+ props . text ?? ""
9598 ) }
9699 </ Button >
97100 </ ThemeProvider >
0 commit comments