mirror of
https://github.com/supabase/supabase.git
synced 2026-12-04 07:29:16 +00:00
## Context We've been seeing many `NotFoundError: Failed to execute 'removeChild' on 'Node'` and `NotFoundError: Failed to execute 'insertBefore' on 'Node'` events on Sentry which are historically known to be caused by Google Translate in the browser. There's technically no _right way_ to address this unfortunately, but one of the solutions which should address most of these issues is to wrap any dynamic text within a span - we've considered that quite a while back tbh but never took the time to do this until today with the help of Claude. Although just a heads up that it might not necessarily completely eradicate those issues. Also added an eslint rule which should prevent future occurences of this <img width="1264" height="192" alt="image" src="https://github.com/user-attachments/assets/b2c32ea0-45a2-4ccd-82fe-1a859905fc29" />
39 lines
1.3 KiB
TypeScript
39 lines
1.3 KiB
TypeScript
import { cn } from 'ui'
|
|
|
|
import { formatCurrency } from '@/lib/helpers'
|
|
|
|
export interface BreakdownRowProps {
|
|
label: string
|
|
description?: string
|
|
children: React.ReactNode
|
|
}
|
|
|
|
export const BreakdownRow = ({ label, description, children }: BreakdownRowProps) => (
|
|
<div className="flex items-start justify-between py-3 px-0 border-b border-dashed last:border-b-0">
|
|
<div className="flex flex-col gap-0.5">
|
|
<span className="text-sm text-foreground-light">{label}</span>
|
|
{description && <span className="text-xs text-warning-600 max-w-72">{description}</span>}
|
|
</div>
|
|
{children}
|
|
</div>
|
|
)
|
|
|
|
export const ValueChange = ({ from, to }: { from: string; to: string }) => (
|
|
<span className="text-sm font-mono uppercase">
|
|
<span className="text-foreground-lighter">{from}</span>
|
|
<span className="text-foreground-lighter mx-2">→</span>
|
|
<span className="text-foreground">{to}</span>
|
|
</span>
|
|
)
|
|
|
|
export const PriceDelta = ({ delta }: { delta: number }) => (
|
|
<span className={cn('text-xs', delta >= 0 ? 'text-primary' : 'text-destructive')}>
|
|
{delta >= 0 ? (
|
|
<span>{`+${formatCurrency(delta)}`}</span>
|
|
) : (
|
|
<span>{`-${formatCurrency(Math.abs(delta))}`}</span>
|
|
)}{' '}
|
|
<span className="text-foreground-lighter">per month</span>
|
|
</span>
|
|
)
|