mirror of
https://github.com/supabase/supabase.git
synced 2026-10-19 08:09:11 +03:00
* Add lucide-react to docs (to make the autocomplete work). * Migrate the docs app icons. * Migrate the ui-patterns. * Remove the old icons from ui package. * Migrate the www app from react-feather icons. * Migrate all of studio icons. * Migrate the only component in design-system. * Fix an old import in ui package. Revert an import in docs app. * Fix some pages in www. * Remove unneeded files used in generation of icons. * Fix a prettier error. * Fix more issues in www. * Fix an issue in Log Date picker. * Replace all string sizes with number sizes because the icons grew in some cases. * Fix more imports in security page. * Fix an extra import. * Remove the size prop from all icons if they're in a button and they match the button size. * Minor fixes for docs and www. --------- Co-authored-by: Joshen Lim <joshenlimek@gmail.com>
65 lines
2.3 KiB
TypeScript
65 lines
2.3 KiB
TypeScript
import { AlertTitle } from '@ui/components/shadcn/ui/alert'
|
|
import { AlertCircle } from 'lucide-react'
|
|
import Link from 'next/link'
|
|
import { AlertDescription_Shadcn_, Alert_Shadcn_, Button } from 'ui'
|
|
|
|
interface RAMWarningsProps {
|
|
isFreePlan: boolean
|
|
upgradeUrl: string
|
|
severity?: 'warning' | 'critical' | null
|
|
}
|
|
|
|
const RAMWarnings = ({ isFreePlan, upgradeUrl, severity }: RAMWarningsProps) => {
|
|
if (severity === 'warning') {
|
|
return (
|
|
<Alert_Shadcn_ variant="warning">
|
|
<AlertCircle />
|
|
<AlertTitle>Your memory usage has exceeded 80%</AlertTitle>
|
|
<AlertDescription_Shadcn_>
|
|
High memory usage could result in overall degraded performance, and in rare cases, your
|
|
instance may become unresponsive. If you need more resources, consider upgrading to a
|
|
larger compute add-on.
|
|
</AlertDescription_Shadcn_>
|
|
<div className="mt-3 flex items-center space-x-2">
|
|
<Button asChild type="default">
|
|
<Link href="https://supabase.com/docs/guides/platform/exhaust-ram">Learn more</Link>
|
|
</Button>
|
|
<Button asChild type="warning">
|
|
<Link href={upgradeUrl}>
|
|
{isFreePlan ? 'Upgrade project' : 'Change compute add-on'}
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
</Alert_Shadcn_>
|
|
)
|
|
}
|
|
|
|
if (severity === 'critical') {
|
|
return (
|
|
<Alert_Shadcn_ variant="destructive">
|
|
<AlertCircle />
|
|
<AlertTitle>Your memory usage has reached 100%</AlertTitle>
|
|
<AlertDescription_Shadcn_>
|
|
High memory usage could result in overall degraded performance, and in rare cases, your
|
|
instance may become unresponsive. If you need more resources, consider upgrading to a
|
|
larger compute add-on.
|
|
</AlertDescription_Shadcn_>
|
|
<div className="mt-3 flex items-center space-x-2">
|
|
<Button asChild type="default">
|
|
<Link href="https://supabase.com/docs/guides/platform/exhaust-cpu">Learn more</Link>
|
|
</Button>
|
|
<Button asChild type="danger">
|
|
<Link href={upgradeUrl}>
|
|
{isFreePlan ? 'Upgrade project' : 'Change compute add-on'}
|
|
</Link>
|
|
</Button>
|
|
</div>
|
|
</Alert_Shadcn_>
|
|
)
|
|
}
|
|
|
|
return null
|
|
}
|
|
|
|
export default RAMWarnings
|