Skip to content

Commit 44df3fa

Browse files
authored
feature/COMPASS-9433 Allow react node in node type prop (#79)
1 parent db2d36b commit 44df3fa

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

src/components/node/node.stories.tsx

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,27 @@ export const DisabledWithHoverVariant: Story = {
221221
},
222222
};
223223

224+
export const NodeWithCustomTypeField: Story = {
225+
args: {
226+
...INTERNAL_NODE,
227+
data: {
228+
title: 'orders',
229+
fields: [
230+
{
231+
name: 'customerId',
232+
type: (
233+
<span>
234+
<strong>custom type display</strong>
235+
</span>
236+
),
237+
variant: 'default',
238+
glyphs: ['key'],
239+
},
240+
],
241+
},
242+
},
243+
};
244+
224245
export const NodeWithPrimaryField: Story = {
225246
args: {
226247
...INTERNAL_NODE,

src/types/node.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ export interface NodeField {
138138
/**
139139
* The type of the field, for example "objectId".
140140
*/
141-
type?: string;
141+
type?: string | React.ReactNode;
142142

143143
/**
144144
* The depth of the field.

0 commit comments

Comments
 (0)