mirror of
https://github.com/supabase/supabase.git
synced 2026-07-03 13:04:33 +08:00
* Replace all usage of useProjectContext with useSelectedProjectQuery * Replace all usage of useSelectedProject with useSelectedProjectQuery * Replace all usage of useProjectByRef with useProjectByRefQuery * Replace all usage of useSelectedOrganization with useSelectedOrganizationQuery * Deprecate useSelectedProject, useSelectedOrganization, and useProjectByRef hooks * Deprecate ProjecContext
33 lines
1.0 KiB
TypeScript
33 lines
1.0 KiB
TypeScript
import Link from 'next/link'
|
|
|
|
import { useSelectedProjectQuery } from 'hooks/misc/useSelectedProject'
|
|
import { Button } from 'ui'
|
|
import { Admonition } from 'ui-patterns/admonition'
|
|
|
|
interface UpgradeDatabaseAlertProps {
|
|
minimumVersion?: string
|
|
}
|
|
|
|
export const UpgradeDatabaseAlert = ({ minimumVersion = '15.6' }: UpgradeDatabaseAlertProps) => {
|
|
const { data: project } = useSelectedProjectQuery()
|
|
|
|
return (
|
|
<Admonition
|
|
type="warning"
|
|
className="mt-4"
|
|
title="Database upgrade needed"
|
|
childProps={{ description: { className: 'flex flex-col gap-y-2' } }}
|
|
>
|
|
<div className="prose text-sm max-w-full">
|
|
<p>
|
|
This integration requires the <code>pgmq</code> extension which is not available on this
|
|
version of Postgres. The extension is available on version {minimumVersion} and higher.
|
|
</p>
|
|
</div>
|
|
<Button color="primary" className="w-fit">
|
|
<Link href={`/project/${project?.ref}/settings/infrastructure`}>Upgrade database</Link>
|
|
</Button>
|
|
</Admonition>
|
|
)
|
|
}
|