Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 26 additions & 15 deletions src/Component/react-inspector/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -108,14 +108,31 @@ class CustomInspector extends React.PureComponent<Props, any> {
return (
<Root data-type={table ? 'table' : dom ? 'html' : 'object'}>
{table ? (
<Table>
<Inspector {...this.props} theme={styles} table />
<Inspector
{...this.props}
theme={styles}
nodeRenderer={this.nodeRenderer.bind(this)}
/>
</Table>
<table
style={{ border: '1px solid black', borderCollapse: 'collapse' }}
>
<thead>
<tr>
<th>(index)</th>
<th>Value</th>
</tr>
</thead>
<tbody>
{Object.keys(data).map((key) => {
if (data[key]?.startsWith?.('__console_feed_')) return null
return (
<tr key={key}>
<td style={{ border: '1px solid black', padding: '8px' }}>
{key}
</td>
<td style={{ border: '1px solid black', padding: '8px' }}>
{data[key]}
</td>
</tr>
)
})}
</tbody>
</table>
) : dom ? (
<HTML>
<DOMInspector {...this.props} theme={styles} />
Expand Down Expand Up @@ -150,13 +167,7 @@ class CustomInspector extends React.PureComponent<Props, any> {
}

if (constructor === 'Promise')
return (
<span style={{ fontStyle: 'italic' }}>
Promise {`{`}
<span style={{ opacity: 0.6 }}>{`<pending>`}</span>
{`}`}
</span>
)
return <span style={{ fontStyle: 'italic' }}>Promise {`{}`}</span>

if (data instanceof HTMLElement)
return (
Expand Down