@@ -6,7 +6,7 @@ import { CopyableValue } from "components/CopyableValue/CopyableValue";
6
6
import { DropdownArrow } from "components/DropdownArrow/DropdownArrow" ;
7
7
import { MemoizedInlineMarkdown } from "components/Markdown/Markdown" ;
8
8
import { Stack } from "components/Stack/Stack" ;
9
- import { Children , type FC , type PropsWithChildren , useState } from "react" ;
9
+ import { Children , type FC , useState } from "react" ;
10
10
import { ResourceAvatar } from "./ResourceAvatar" ;
11
11
import { SensitiveValue } from "./SensitiveValue" ;
12
12
@@ -75,14 +75,6 @@ export interface ResourceCardProps {
75
75
agentRow : ( agent : WorkspaceAgent ) => JSX . Element ;
76
76
}
77
77
78
- const p : FC < PropsWithChildren > = ( { children } ) => {
79
- const childrens = Children . toArray ( children ) ;
80
- if ( childrens . every ( ( child ) => typeof child === "string" ) ) {
81
- return < CopyableValue value = { childrens . join ( "" ) } > { children } </ CopyableValue > ;
82
- }
83
- return < > { children } </ > ;
84
- } ;
85
-
86
78
export const ResourceCard : FC < ResourceCardProps > = ( { resource, agentRow } ) => {
87
79
const [ shouldDisplayAllMetadata , setShouldDisplayAllMetadata ] =
88
80
useState ( false ) ;
@@ -146,7 +138,25 @@ export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
146
138
{ meta . sensitive ? (
147
139
< SensitiveValue value = { meta . value } />
148
140
) : (
149
- < MemoizedInlineMarkdown components = { { p } } >
141
+ < MemoizedInlineMarkdown
142
+ components = { {
143
+ p : ( { children } ) => {
144
+ const childrens = Children . toArray ( children ) ;
145
+ if (
146
+ childrens . every (
147
+ ( child ) => typeof child === "string" ,
148
+ )
149
+ ) {
150
+ return (
151
+ < CopyableValue value = { childrens . join ( "" ) } >
152
+ { children }
153
+ </ CopyableValue >
154
+ ) ;
155
+ }
156
+ return < > { children } </ > ;
157
+ } ,
158
+ } }
159
+ >
150
160
{ meta . value }
151
161
</ MemoizedInlineMarkdown >
152
162
) }
0 commit comments