From 3c4035097ae78e93136b0a6fcaea80cdb84de253 Mon Sep 17 00:00:00 2001 From: Gregory Schier Date: Thu, 12 Mar 2026 19:48:43 -0700 Subject: [PATCH] FormattedError --- apps/yaak-client/components/ErrorBoundary.tsx | 3 +-- apps/yaak-client/components/GrpcEditor.tsx | 3 +-- apps/yaak-client/components/RouteError.tsx | 4 +--- apps/yaak-client/components/graphql/GraphQLEditor.tsx | 3 +-- apps/yaak-client/lib/importData.tsx | 3 +-- .../core => packages/ui/src/components}/FormattedError.tsx | 0 packages/ui/src/index.ts | 1 + 7 files changed, 6 insertions(+), 11 deletions(-) rename {apps/yaak-client/components/core => packages/ui/src/components}/FormattedError.tsx (100%) diff --git a/apps/yaak-client/components/ErrorBoundary.tsx b/apps/yaak-client/components/ErrorBoundary.tsx index 49aa7024..0772e953 100644 --- a/apps/yaak-client/components/ErrorBoundary.tsx +++ b/apps/yaak-client/components/ErrorBoundary.tsx @@ -1,8 +1,7 @@ +import { Banner, Button, InlineCode } from '@yaakapp-internal/ui'; import type { ErrorInfo, ReactNode } from 'react'; import { Component, useEffect } from 'react'; import { showDialog } from '../lib/dialog'; -import { Banner, InlineCode } from '@yaakapp-internal/ui'; -import { Button } from './core/Button'; import RouteError from './RouteError'; interface ErrorBoundaryProps { diff --git a/apps/yaak-client/components/GrpcEditor.tsx b/apps/yaak-client/components/GrpcEditor.tsx index 55855498..274e51ca 100644 --- a/apps/yaak-client/components/GrpcEditor.tsx +++ b/apps/yaak-client/components/GrpcEditor.tsx @@ -2,7 +2,7 @@ import { linter } from '@codemirror/lint'; import type { EditorView } from '@codemirror/view'; import { jsoncLanguage } from '@shopify/lang-jsonc'; import type { GrpcRequest } from '@yaakapp-internal/models'; -import { InlineCode, VStack } from '@yaakapp-internal/ui'; +import { FormattedError, InlineCode, VStack } from '@yaakapp-internal/ui'; import classNames from 'classnames'; import { handleRefresh, @@ -19,7 +19,6 @@ import { pluralizeCount } from '../lib/pluralize'; import { Button } from './core/Button'; import type { EditorProps } from './core/Editor/Editor'; import { Editor } from './core/Editor/LazyEditor'; -import { FormattedError } from './core/FormattedError'; import { GrpcProtoSelectionDialog } from './GrpcProtoSelectionDialog'; type Props = Pick & { diff --git a/apps/yaak-client/components/RouteError.tsx b/apps/yaak-client/components/RouteError.tsx index e4a7e967..a843c89a 100644 --- a/apps/yaak-client/components/RouteError.tsx +++ b/apps/yaak-client/components/RouteError.tsx @@ -1,7 +1,5 @@ -import { Heading, VStack } from '@yaakapp-internal/ui'; -import { Button } from './core/Button'; +import { Button, FormattedError, Heading, VStack } from '@yaakapp-internal/ui'; import { DetailsBanner } from './core/DetailsBanner'; -import { FormattedError } from './core/FormattedError'; export default function RouteError({ error }: { error: unknown }) { console.log('Error', error); diff --git a/apps/yaak-client/components/graphql/GraphQLEditor.tsx b/apps/yaak-client/components/graphql/GraphQLEditor.tsx index d72b7d95..4b70df68 100644 --- a/apps/yaak-client/components/graphql/GraphQLEditor.tsx +++ b/apps/yaak-client/components/graphql/GraphQLEditor.tsx @@ -11,8 +11,7 @@ import type { DropdownItem } from '../core/Dropdown'; import { Dropdown } from '../core/Dropdown'; import type { EditorProps } from '../core/Editor/Editor'; import { Editor } from '../core/Editor/LazyEditor'; -import { FormattedError } from '../core/FormattedError'; -import { Banner, Icon } from '@yaakapp-internal/ui'; +import { Banner, FormattedError, Icon } from '@yaakapp-internal/ui'; import { Separator } from '../core/Separator'; import { tryFormatGraphql } from '../../lib/formatters'; import { showGraphQLDocExplorerAtom } from './graphqlAtoms'; diff --git a/apps/yaak-client/lib/importData.tsx b/apps/yaak-client/lib/importData.tsx index 42268a54..f38a7085 100644 --- a/apps/yaak-client/lib/importData.tsx +++ b/apps/yaak-client/lib/importData.tsx @@ -1,7 +1,6 @@ import type { BatchUpsertResult } from '@yaakapp-internal/models'; -import { VStack } from '@yaakapp-internal/ui'; +import { FormattedError, VStack } from '@yaakapp-internal/ui'; import { Button } from '../components/core/Button'; -import { FormattedError } from '../components/core/FormattedError'; import { ImportDataDialog } from '../components/ImportDataDialog'; import { activeWorkspaceAtom } from '../hooks/useActiveWorkspace'; import { createFastMutation } from '../hooks/useFastMutation'; diff --git a/apps/yaak-client/components/core/FormattedError.tsx b/packages/ui/src/components/FormattedError.tsx similarity index 100% rename from apps/yaak-client/components/core/FormattedError.tsx rename to packages/ui/src/components/FormattedError.tsx diff --git a/packages/ui/src/index.ts b/packages/ui/src/index.ts index b6c9750b..1665584a 100644 --- a/packages/ui/src/index.ts +++ b/packages/ui/src/index.ts @@ -9,6 +9,7 @@ export type { IconProps } from './components/Icon'; export { Icon } from './components/Icon'; export type { IconButtonProps } from './components/IconButton'; export { IconButton } from './components/IconButton'; +export { FormattedError } from './components/FormattedError'; export { InlineCode } from './components/InlineCode'; export { LoadingIcon } from './components/LoadingIcon'; export { Overlay } from './components/Overlay';