Skip to content

Commit

Permalink
feat(sanity): add "Copy error details" button to document list error UI
Browse files Browse the repository at this point in the history
  • Loading branch information
juice49 committed Sep 18, 2024
1 parent 118bc06 commit 5b7c332
Showing 1 changed file with 2 additions and 13 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import {SyncIcon} from '@sanity/icons'
import {type SanityDocument} from '@sanity/types'
import {Box, Container, Flex, Heading, Stack, Text} from '@sanity/ui'
import {useCallback, useEffect, useMemo, useState} from 'react'
import {
CommandList,
type CommandListRenderItemCallback,
ErrorActions,
type GeneralPreviewLayoutKey,
getPublishedId,
LoadingBlock,
Expand All @@ -15,7 +15,6 @@ import {
} from 'sanity'
import {styled} from 'styled-components'

import {Button} from '../../../ui-components'
import {Delay, PaneContent, PaneItem, usePane, usePaneLayout} from '../../components'
import {structureLocaleNamespace} from '../../i18n'
import {FULL_LIST_LIMIT} from './constants'
Expand Down Expand Up @@ -198,17 +197,7 @@ export function DocumentListPaneContent(props: DocumentListPaneContentProps) {
components={{Code: ({children}) => <code>{children}</code>}}
/>
</Text>

{onRetry && (
<Box>
<Button
icon={SyncIcon}
onClick={onRetry}
text={t('panes.document-list-pane.error.retry-button.text')}
tone="primary"
/>
</Box>
)}
<ErrorActions error={error} eventId={null} onRetry={onRetry} />
</Stack>
</Container>
</Flex>
Expand Down

0 comments on commit 5b7c332

Please sign in to comment.