@@ -18,6 +18,7 @@ interface ActionButtonsProps {
1818 handleClone : ( name : string , id : string ) => void ;
1919 mode : string ;
2020 isCloneDisabled : boolean ;
21+ showOpenPlaygroundButton : boolean ;
2122}
2223
2324const ActionButtons : React . FC < ActionButtonsProps > = ( {
@@ -28,7 +29,8 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
2829 isCloneLoading,
2930 handleClone,
3031 mode,
31- isCloneDisabled
32+ isCloneDisabled,
33+ showOpenPlaygroundButton
3234} ) => {
3335 const cleanedType = type . replace ( 'my-' , '' ) . replace ( / s $ / , '' ) ;
3436 const resourcePlaygroundType = Object . values ( {
@@ -51,7 +53,7 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
5153 < ActionButton
5254 sx = { {
5355 borderRadius : '0.2rem' ,
54- backgroundColor : 'background.inverse' ,
56+ backgroundColor : charcoal [ 10 ] ,
5557 gap : '10px' ,
5658 color : charcoal [ 100 ]
5759 } }
@@ -87,27 +89,29 @@ const ActionButtons: React.FC<ActionButtonsProps> = ({
8789 ) }
8890 </ div >
8991 ) }
90- < LinkUrl
91- style = { { width : '100%' } }
92- href = { `https://playground.meshery.io/extension/meshmap?mode=${ mode } &type=${ resourcePlaygroundType } &id=${ cardId } &name=${ slugify (
93- details . name
94- ) } `}
95- target = "_blank"
96- rel = "noreferrer"
97- >
98- < ActionButton
99- sx = { {
100- borderRadius : '0.2rem' ,
101- backgroundColor : 'background.cta.default' ,
102- color : charcoal [ 10 ] ,
103- gap : '10px' ,
104- width : '100%'
105- } }
92+ { showOpenPlaygroundButton && (
93+ < LinkUrl
94+ style = { { width : '100%' } }
95+ href = { `https://playground.meshery.io/extension/meshmap?mode=${ mode } &type=${ resourcePlaygroundType } &id=${ cardId } &name=${ slugify (
96+ details . name
97+ ) } `}
98+ target = "_blank"
99+ rel = "noreferrer"
106100 >
107- < KanvasIcon width = { 24 } height = { 24 } primaryFill = { charcoal [ 10 ] } fill = { charcoal [ 10 ] } />
108- Open in Playground
109- </ ActionButton >
110- </ LinkUrl >
101+ < ActionButton
102+ sx = { {
103+ borderRadius : '0.2rem' ,
104+ backgroundColor : 'background.cta.default' ,
105+ color : charcoal [ 10 ] ,
106+ gap : '10px' ,
107+ width : '100%'
108+ } }
109+ >
110+ < KanvasIcon width = { 24 } height = { 24 } primaryFill = { charcoal [ 10 ] } fill = { charcoal [ 10 ] } />
111+ Open in Playground
112+ </ ActionButton >
113+ </ LinkUrl >
114+ ) }
111115 </ StyledActionWrapper >
112116 ) ;
113117} ;
0 commit comments