@@ -2,7 +2,7 @@ import {Runtime} from "@code0-tech/sagittarius-graphql-types";
22import React from "react" ;
33import { Text } from "../text/Text" ;
44import { Flex } from "../flex/Flex" ;
5- import { IconSettings } from "@tabler/icons-react" ;
5+ import { IconServer , IconSettings } from "@tabler/icons-react" ;
66import { Button } from "../button/Button" ;
77import { useService , useStore } from "../../utils" ;
88import { DRuntimeReactiveService } from "./DRuntime.service" ;
@@ -12,12 +12,14 @@ import {DRuntimeView} from "./DRuntime.view";
1212export interface DRuntimeContentProps {
1313 runtimeId : Runtime [ 'id' ]
1414 onSetting ?: ( runtime : DRuntimeView ) => void
15+ minimized ?: boolean
1516}
1617
1718export const DRuntimeContent : React . FC < DRuntimeContentProps > = ( props ) => {
1819
1920 const {
2021 runtimeId,
22+ minimized = false ,
2123 onSetting = ( ) => {
2224 }
2325 } = props
@@ -26,15 +28,25 @@ export const DRuntimeContent: React.FC<DRuntimeContentProps> = (props) => {
2628 const runtimeStore = useStore ( DRuntimeReactiveService )
2729 const runtime = React . useMemo ( ( ) => runtimeService . getById ( runtimeId ) , [ runtimeStore , runtimeId ] )
2830
29- return < Flex justify = { "space-between" } align = { "center" } >
31+ return < Flex justify = { "space-between" } align = { "center" } style = { { gap : "1.3rem" } } >
32+
33+ { minimized ? (
34+ < Flex align = { "center" } style = { { gap : "0.7rem" } } >
35+ < IconServer size = { 16 } />
36+ < Text size = { "md" } hierarchy = { "secondary" } display = { "block" } >
37+ { runtime ?. name }
38+ </ Text >
39+ </ Flex >
40+ ) : (
3041 < Flex style = { { flexDirection : "column" , gap : "0.35rem" } } >
31- < Text size = { "lg" } hierarchy = { "primary " } display = { "block" } >
42+ < Text size = { "lg" } hierarchy = { "secondary " } display = { "block" } >
3243 { runtime ?. name }
3344 </ Text >
3445 < Text size = { "sm" } hierarchy = { "tertiary" } display = { "block" } >
3546 { runtime ?. description }
3647 </ Text >
3748 </ Flex >
49+ ) }
3850 < Flex align = { "center" } style = { { gap : "1.3rem" } } >
3951 < Flex align = { "center" } style = { { gap : "0.35rem" , flexWrap : "wrap" } } >
4052 { runtime ?. status === "CONNECTED" ? (
@@ -43,7 +55,7 @@ export const DRuntimeContent: React.FC<DRuntimeContentProps> = (props) => {
4355 < Badge color = { "error" } > DISCONNECTED</ Badge >
4456 ) }
4557 </ Flex >
46- { runtime ?. userAbilities ?. deleteRuntime || runtime ?. userAbilities ?. updateRuntime || runtime ?. userAbilities ?. rotateRuntimeToken ? (
58+ { ! minimized && ( runtime ?. userAbilities ?. deleteRuntime || runtime ?. userAbilities ?. updateRuntime || runtime ?. userAbilities ?. rotateRuntimeToken ) ? (
4759 < Button color = { "secondary" } onClick = { ( event ) => {
4860 event . stopPropagation ( )
4961 onSetting ( runtime )
0 commit comments