/
RcsbFvRowMark.tsx
37 lines (31 loc) · 1.33 KB
/
RcsbFvRowMark.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import React from "react";
import classes from "../../scss/RcsbFvRow.module.scss";
import {ReactNode} from "react";
export interface RcsbFvRowMarkInterface<T> extends RcsbFvRowMarkPublicInterface<T>{
isGlowing: boolean;
}
export interface RcsbFvRowMarkPublicInterface<T> extends RcsbFvRowMarkCallbackInterface {
externalRowMark?: {
component:typeof React.Component<T>;
props:T;
}
}
interface RcsbFvRowMarkCallbackInterface {
clickCallback?:()=>void;
hoverCallback?:()=>void;
}
export class RcsbFvRowMark<T> extends React.Component <RcsbFvRowMarkInterface<T>,{}> {
public render(): ReactNode {
return (<div className={classes.rcsbFvRowMark} style={{display:"inline-block"}}>
<div>
{
this.props.externalRowMark ? <this.props.externalRowMark.component isGlowing={this.props.isGlowing} clickCallback={this.props.clickCallback} hoverCallback={this.props.hoverCallback} {...this.props.externalRowMark.props}/> : (
<div onClick={this.props.clickCallback} onMouseOver={this.props.hoverCallback} style={{width:6, height:6, marginBottom: 4, marginRight:5}} >
<div className={classes.rcsbFvRowMarkComponent}/>
</div>
)
}
</div>
</div>);
}
}