Skip to content

Commit bcda534

Browse files
committed
✨ references ✨
1 parent 73acdc8 commit bcda534

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

site/src/components/Resources/ResourceCard.tsx

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,12 +74,16 @@ export interface ResourceCardProps {
7474
agentRow: (agent: WorkspaceAgent) => JSX.Element;
7575
}
7676

77-
const p = ({ children }: PropsWithChildren) => {
78-
const childrens = Children.toArray(children);
79-
if (childrens.every((child) => typeof child === "string")) {
80-
return <CopyableValue value={childrens.join("")}>{children}</CopyableValue>;
81-
}
82-
return <>{children}</>;
77+
const markdownComponents = {
78+
p: ({ children }: PropsWithChildren) => {
79+
const childrens = Children.toArray(children);
80+
if (childrens.every((child) => typeof child === "string")) {
81+
return (
82+
<CopyableValue value={childrens.join("")}>{children}</CopyableValue>
83+
);
84+
}
85+
return <>{children}</>;
86+
},
8387
};
8488

8589
export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
@@ -146,7 +150,7 @@ export const ResourceCard: FC<ResourceCardProps> = ({ resource, agentRow }) => {
146150
{meta.sensitive ? (
147151
<SensitiveValue value={meta.value} />
148152
) : (
149-
<MemoizedInlineMarkdown components={{ p }}>
153+
<MemoizedInlineMarkdown components={markdownComponents}>
150154
{meta.value}
151155
</MemoizedInlineMarkdown>
152156
)}

0 commit comments

Comments
 (0)