TmRowTitleComponent.tsx 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. import * as React from "react";
  2. import {RcsbFvRowConfigInterface} from "@rcsb/rcsb-saguaro";
  3. import { RcsbFvRowTitleInterface } from "@rcsb/rcsb-saguaro/build/RcsbFv/RcsbFvRow/RcsbFvRowTitle";
  4. interface TmRowTitleState {
  5. title: string,
  6. expandTitle: boolean;
  7. disabled: boolean;
  8. titleColor?: string;
  9. blocked:boolean;
  10. }
  11. export class TmRowTitleComponent extends React.Component<RcsbFvRowTitleInterface, TmRowTitleState> {
  12. private readonly configData : RcsbFvRowConfigInterface;
  13. readonly state = {
  14. title: 'STATE TITLE',
  15. expandTitle: false,
  16. disabled: true,
  17. blocked:false
  18. };
  19. constructor(props: any) {
  20. super(props);
  21. this.configData = (this.props as any).data;
  22. }
  23. public render(): JSX.Element{
  24. return (
  25. <div style={{textAlign:"right", display:"flex"}}
  26. // onMouseOver={()=>this.hover(true)}
  27. // onMouseOut={()=>this.hover(false)}
  28. >
  29. <div>
  30. <div style={{
  31. MozUserSelect:"none",
  32. WebkitUserSelect:"none",
  33. msUserSelect:"none",
  34. //color: this.state.titleColor,
  35. cursor: this.state.blocked ? "wait" : "pointer",
  36. maxWidth: (this.configData.rowTitleWidth ?? 190) - 60,
  37. overflow: "hidden",
  38. textOverflow: "ellipsis",
  39. whiteSpace: "nowrap",
  40. textAlign: "right"
  41. }}
  42. // onClick={(e: MouseEvent)=>this.click(e)}
  43. // title={this.props.targetAlignment.target_id ?? undefined}
  44. title={'TITLE'}
  45. >
  46. <a href="https://rcsb.org/">{this.state.title}</a>
  47. </div>
  48. </div>
  49. </div>
  50. );
  51. }
  52. }