Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Fix/build issue react flow (#44119)

Joshen Lim29f5c4c44a5a
diff --git a/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/Edges.tsx b/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/Edges.tsx
index 34afc5a315d..391ffe13942 100644
--- a/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/Edges.tsx
+++ b/apps/studio/components/interfaces/Database/Replication/ReplicationDiagram/Edges.tsx
@@ -1,13 +1,21 @@
+import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath, type EdgeProps } from '@xyflow/react'
import { useParams } from 'common'
import { useReplicationLagQuery } from 'data/read-replicas/replica-lag-query'
import { formatDatabaseID } from 'data/read-replicas/replicas.utils'
import { Loader2, X } from 'lucide-react'
-import type { EdgeProps } from 'reactflow'
-import { BaseEdge, EdgeLabelRenderer, getSmoothStepPath } from 'reactflow'
import { cn, Tooltip, TooltipContent, TooltipTrigger } from 'ui'
import { useSelectedProjectQuery } from '@/hooks/misc/useSelectedProject'
+type EdgeData = {
+ type: string
+ identifier: string
+ isComingUp: boolean
+ isReplicating: boolean
+ isFailed: boolean
+ shiftEdgeEnd: boolean
+}
+
export const SmoothstepEdge = ({
sourceX,
sourceY,
@@ -22,7 +30,8 @@ export const SmoothstepEdge = ({
const { ref } = useParams()
const { data: project } = useSelectedProjectQuery()
- const { type, identifier, isComingUp, isReplicating, isFailed, shiftEdgeEnd } = data || {}
+ const { type, identifier, isComingUp, isReplicating, isFailed, shiftEdgeEnd } = (data ||
+ {}) as EdgeData
const formattedId = type === 'replica' ? formatDatabaseID(identifier ?? '') : identifier
const [edgePath, labelX, labelY] = getSmoothStepPath({