Skip to content

armgit / spree

Public Imported from GitHub
0

Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.

700 B
Raw Blame
import { Button } from '@spree/dashboard-ui'
import { useTranslation } from 'react-i18next'
import { CenteredMessage } from './centered-message'

/**
 * Shown when a page's own query failed, in place of its content.
 *
 * Distinct from a "not found" message on purpose: a failed request and a
 * missing record send the seller looking for different causes, and only one
 * of the two is worth retrying.
 */
export function RetryableError({ onRetry }: { onRetry: () => void }) {
  const { t } = useTranslation()

  return (
    <CenteredMessage>
      {t('common.error')}{' '}
      <Button variant="outline" onClick={onRetry}>
        {t('common.retry')}
      </Button>
    </CenteredMessage>
  )
}