packageDocumentation module import "./Placeholder.scss" ; import classnames from "classnames" ; import * as React from "react" ; import { CommonProps } from "../utils/Props" ; import { LEVEL_OFFSET } from "./Node" ; public export interface TreeNodePlaceholderProps extends CommonProps { level : number ; minWidth ? : number ; maxWidth ? : number ; [ "data-testid" ] ? : string ; } public export class TreeNodePlaceholder extends React . PureComponent < TreeNodePlaceholderProps > { public override render ( ) { const className = classnames ( "core-tree-placeholder" , this . props . className ) ; const offset = this . props . level * LEVEL_OFFSET ; const min = ( this . props . minWidth || 50 ) ; const max = ( this . props . maxWidth || 200 ) ; const width = Math . floor ( min + Math . random ( ) * ( max - min ) ) ; const style = { ... this . props . style , paddingLeft : `${ offset }px` } ; return ( < div className = { className } style = { style } data - testid = { this . props [ "data-testid" ] } > < div className = "contents" style = { { width : `${ width }px` } } /> < /div>); } }