github.com/filecoin-project/bacalhau@v0.3.23-0.20230228154132-45c989550ace/dashboard/frontend/src/components/widgets/TerminalWindow.tsx (about)

     1  import React, { FC } from 'react'
     2  import Window, { WindowProps } from './Window'
     3  import TerminalText, { TerminalTextConfig } from './TerminalText'
     4  
     5  type TerminalWindowProps = {
     6    data: any,
     7    title?: string,
     8    onClose: {
     9      (): void,
    10    }
    11  } & WindowProps & TerminalTextConfig
    12  
    13  const TerminalWindow: FC<TerminalWindowProps> = ({
    14    data,
    15    title = 'Data',
    16    color,
    17    backgroundColor,
    18    onClose,
    19    ...windowProps
    20  }) => {
    21    return (
    22      <Window
    23        withCancel
    24        compact
    25        title={ title }
    26        onCancel={ onClose }
    27        cancelTitle="Close"
    28        {...windowProps}
    29      >
    30        <TerminalText
    31          data={ data }
    32          color={ color }
    33          backgroundColor={ backgroundColor }
    34        />
    35      </Window>
    36    )
    37  }
    38  
    39  export default TerminalWindow