go.charczuk.com@v0.0.0-20240327042549-bc490516bd1a/projects/nodes/static/_nextjs/src/components/dialogLogs.tsx (about)

     1  /**
     2   * Copyright (c) 2024 - Present. Will Charczuk. All rights reserved.
     3   * Use of this source code is governed by a MIT license that can be found in the LICENSE file at the root of the repository.
     4   */
     5  import { Button, Dialog, DialogBody, DialogFooter, Tooltip } from "@blueprintjs/core";
     6  
     7  export interface DialogLogsProps {
     8    isOpen: boolean;
     9    stabilizationNum?: number;
    10    logs?: string;
    11    onClose: () => void;
    12  }
    13  
    14  export function DialogLogs(props: DialogLogsProps) {
    15    return (
    16      <Dialog title={`Stabilization Logs`}
    17        autoFocus={false}
    18        isOpen={props.isOpen}
    19        onClose={props.onClose}
    20        icon="application"
    21        canEscapeKeyClose={true}
    22        isCloseButtonShown={true}
    23        className="dialog-logs"
    24      >
    25        <DialogBody>
    26          {props.logs ? (
    27            <pre>{props.logs}</pre>
    28          ) : <pre className="bp5-skeleton"></pre>}
    29        </DialogBody>
    30        <DialogFooter actions={<>
    31          <Tooltip content="Close the dialog">
    32            <Button onClick={props.onClose} icon="cross">Close</Button>
    33          </Tooltip>
    34        </>}>
    35        </DialogFooter>
    36      </Dialog>
    37    )
    38  }