import { Widget, WidgetConstructor } from "./Widget"
import { DynamicValue } from "../../DynamicValue"
import { staticImplements } from "../../utils/staticImplements"
/**
* A [[Widget]] to display a [[DynamicValue]] holding a string
*
* @example
* ```jsx
* new DynamicText({text:new TextValue("test")})
* //JSX
*
* ```
*/
@staticImplements}>>()
export class DynamicText implements Widget {
text:DynamicValue
__variant__="DynamicText"
constructor({text}:{text:DynamicValue}){
this.text = text
}
static fromJSON(json: { text: any }){
return new DynamicText({text:DynamicValue.fromJSON(json.text)})
}
}