fix(striker-ui): enable end adnorment in Preview title

main
Tsu-ba-me 3 years ago
parent d81b0e54d7
commit 03e04a0a07
  1. 18
      striker-ui/components/Display/Preview.tsx

@ -1,4 +1,11 @@
import { Dispatch, FC, SetStateAction, useEffect, useState } from 'react';
import {
Dispatch,
FC,
ReactNode,
SetStateAction,
useEffect,
useState,
} from 'react';
import { Box, IconButton as MUIIconButton } from '@mui/material';
import {
DesktopWindows as DesktopWindowsIcon,
@ -14,6 +21,7 @@ import { BodyText, HeaderText } from '../Text';
type PreviewOptionalProps = {
externalPreview?: string;
headerEndAdornment?: ReactNode;
isExternalPreviewStale?: boolean;
isFetchPreview?: boolean;
isShowControls?: boolean;
@ -28,6 +36,7 @@ type PreviewProps = PreviewOptionalProps & {
const PREVIEW_DEFAULT_PROPS: Required<PreviewOptionalProps> = {
externalPreview: '',
headerEndAdornment: null,
isExternalPreviewStale: false,
isFetchPreview: true,
isShowControls: true,
@ -64,6 +73,7 @@ const PreviewPanelHeader: FC<{ isUseInnerPanel: boolean; text: string }> = ({
const Preview: FC<PreviewProps> = ({
externalPreview = PREVIEW_DEFAULT_PROPS.externalPreview,
headerEndAdornment,
isExternalPreviewStale = PREVIEW_DEFAULT_PROPS.isExternalPreviewStale,
isFetchPreview = PREVIEW_DEFAULT_PROPS.isFetchPreview,
isShowControls = PREVIEW_DEFAULT_PROPS.isShowControls,
@ -106,8 +116,10 @@ const Preview: FC<PreviewProps> = ({
<PreviewPanel isUseInnerPanel={isUseInnerPanel}>
<PreviewPanelHeader
isUseInnerPanel={isUseInnerPanel}
text={`Server: ${serverName}`}
/>
text={`${serverName}`}
>
{headerEndAdornment}
</PreviewPanelHeader>
<Box
sx={{
display: 'flex',

Loading…
Cancel
Save