diff --git a/apps/studio/components/interfaces/BranchManagement/DatabaseDiffPanel.tsx b/apps/studio/components/interfaces/BranchManagement/DatabaseDiffPanel.tsx index 93fb81abf63..9a04a071d04 100644 --- a/apps/studio/components/interfaces/BranchManagement/DatabaseDiffPanel.tsx +++ b/apps/studio/components/interfaces/BranchManagement/DatabaseDiffPanel.tsx @@ -1,9 +1,8 @@ import Link from 'next/link' -import { Database, Wind } from 'lucide-react' -import { Card, CardContent, CardHeader, CardTitle } from 'ui' +import { CircleAlert, Database, Wind } from 'lucide-react' +import { Card, CardContent, CardHeader, CardTitle, Skeleton } from 'ui' import DiffViewer from 'components/ui/DiffViewer' -import { Loading, ErrorState, EmptyState } from 'components/ui/AsyncState' interface DatabaseDiffPanelProps { diffContent?: string @@ -19,18 +18,28 @@ const DatabaseDiffPanel = ({ error, currentBranchRef, }: DatabaseDiffPanelProps) => { - if (isLoading) return + if (isLoading) return - if (error) return + if (error) + return ( +
+ +

Error loading branch diff

+

+ Please try again in a few minutes and contact support if the problem persists. +

+
+ ) - // Handle empty diff content if (!diffContent || diffContent.trim() === '') { return ( - +
+ +

No changes detected between branches

+

+ Any changes to your database schema will be shown here for review +

+
) } diff --git a/apps/studio/components/interfaces/BranchManagement/EdgeFunctionsDiffPanel.tsx b/apps/studio/components/interfaces/BranchManagement/EdgeFunctionsDiffPanel.tsx index 5021614d5b1..8a65e3c9ca9 100644 --- a/apps/studio/components/interfaces/BranchManagement/EdgeFunctionsDiffPanel.tsx +++ b/apps/studio/components/interfaces/BranchManagement/EdgeFunctionsDiffPanel.tsx @@ -2,7 +2,6 @@ import { Code, Wind } from 'lucide-react' import Link from 'next/link' import { useEffect, useMemo, useState } from 'react' -import { EmptyState, Loading } from 'components/ui/AsyncState' import DiffViewer from 'components/ui/DiffViewer' import type { EdgeFunctionBodyData } from 'data/edge-functions/edge-function-body-query' import type { @@ -12,7 +11,7 @@ import type { } from 'hooks/branches/useEdgeFunctionsDiff' import { EMPTY_ARR } from 'lib/void' import { basename } from 'path' -import { Card, CardContent, CardHeader, CardTitle, cn } from 'ui' +import { Card, CardContent, CardHeader, CardTitle, cn, Skeleton } from 'ui' interface EdgeFunctionsDiffPanelProps { diffResults: EdgeFunctionsDiffResult @@ -146,16 +145,18 @@ const EdgeFunctionsDiffPanel = ({ mainBranchRef, }: EdgeFunctionsDiffPanelProps) => { if (diffResults.isLoading) { - return + return } if (!diffResults.hasChanges) { return ( - +
+ +

No changes detected between branches

+

+ Any changes to your edge functions will be shown here for review +

+
) } diff --git a/apps/studio/components/ui/AsyncState.tsx b/apps/studio/components/ui/AsyncState.tsx deleted file mode 100644 index d50b2c52cc5..00000000000 --- a/apps/studio/components/ui/AsyncState.tsx +++ /dev/null @@ -1,34 +0,0 @@ -import { Skeleton } from 'ui' -import { CircleAlert, LucideIcon, Wind } from 'lucide-react' - -export const Loading = () => - -export const ErrorState = ({ - message = 'An unexpected error has occurred', -}: { - message?: string -}) => ( -
- -

{message}

-

- Please try again in a few minutes and contact support if the problem persists. -

-
-) - -export const EmptyState = ({ - title, - description, - icon: Icon = Wind, -}: { - title: string - description: string - icon?: LucideIcon -}) => ( -
- -

{title}

-

{description}

-
-)