Skip to content

Commit

Permalink
Port ToolButtonsGroup (#74099)
Browse files Browse the repository at this point in the history
Ported the ToolButtonsGroup:

![CleanShot 2024-12-19 at 06 41 51](https://github.com/user-attachments/assets/11ac5d7e-057a-4bdc-bf0e-313410046612)
  • Loading branch information
devjiwonchoi authored Dec 20, 2024
1 parent f5912f7 commit e79be05
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import type { DebugInfo } from '../../../../types'
import { CopyButton } from '../copy-button'
import { NodejsInspectorCopyButton } from '../nodejs-inspector'

type ToolButtonsGroupProps = {
error: Error
debugInfo: DebugInfo | undefined
}

export function ToolButtonsGroup({ error, debugInfo }: ToolButtonsGroupProps) {
return (
<span>
<CopyButton
data-nextjs-data-runtime-error-copy-stack
actionLabel="Copy error stack"
successLabel="Copied"
content={error.stack || ''}
disabled={!error.stack}
/>
<NodejsInspectorCopyButton
devtoolsFrontendUrl={debugInfo?.devtoolsFrontendUrl}
/>
</span>
)
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,14 @@ import {
type HydrationErrorState,
getHydrationWarningType,
} from '../helpers/hydration-error-info'
import { NodejsInspectorCopyButton } from '../components/nodejs-inspector'
import { CopyButton } from '../components/copy-button'
import {
getUnhandledErrorType,
isUnhandledConsoleOrRejection,
} from '../helpers/console-error'
import { extractNextErrorCode } from '../../../../../../lib/error-telemetry-utils'
import { ErrorIndicator } from '../components/Errors/ErrorIndicator/ErrorIndicator'
import { ErrorPagination } from '../components/Errors/ErrorPagination/ErrorPagination'
import { ToolButtonsGroup } from '../components/ToolButtonsGroup/ToolButtonsGroup'

export type SupportedErrorEvent = {
id: number
Expand Down Expand Up @@ -297,19 +296,7 @@ export function Errors({
? 'Console Error'
: 'Unhandled Runtime Error'}
</h1>
<span>
<CopyButton
data-nextjs-data-runtime-error-copy-stack
actionLabel="Copy error stack"
successLabel="Copied"
content={error.stack || ''}
disabled={!error.stack}
/>

<NodejsInspectorCopyButton
devtoolsFrontendUrl={debugInfo?.devtoolsFrontendUrl}
/>
</span>
<ToolButtonsGroup error={error} debugInfo={debugInfo} />
</div>
<p
id="nextjs__container_errors_desc"
Expand Down

0 comments on commit e79be05

Please sign in to comment.