Files
5f533247e1 Update docs url to env var (#38772)
* Update Supabase docs URLs to use env variable

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for documentation links

This change centralizes documentation links using a new DOCS_URL constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* Refactor: Use DOCS_URL constant for all documentation links

This change replaces hardcoded documentation URLs with a centralized constant, improving maintainability and consistency.

Co-authored-by: a <a@alaisteryoung.com>

* replace more instances

* ci: Autofix updates from GitHub workflow

* remaining instances

* fix duplicate useRouter

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: alaister <10985857+alaister@users.noreply.github.com>
2025-09-26 10:16:33 +00:00

81 lines
2.4 KiB
TypeScript

import type { Branch } from 'data/branches/branches-query'
import { Github } from 'lucide-react'
import Link from 'next/link'
import { BranchSelector } from './BranchSelector'
import { DocsButton } from 'components/ui/DocsButton'
import { DOCS_URL } from 'lib/constants'
import { Button } from 'ui'
const EMPTY_STATE_CONTAINER = 'flex items-center flex-col justify-center w-full py-10 px-4'
export const PullRequestsEmptyState = ({
url,
projectRef,
branches,
onBranchSelected,
isUpdating,
githubConnection,
gitlessBranching = false,
}: {
url: string
projectRef: string
branches: Branch[]
onBranchSelected: (branch: Branch) => void
isUpdating: boolean
githubConnection?: any
gitlessBranching: boolean
}) => {
return (
<div className={EMPTY_STATE_CONTAINER}>
<p>No merge requests</p>
<p className="text-foreground-light text-center">
Create your first merge request to merge changes back to the main branch
</p>
<div className="flex items-center space-x-2 mt-4">
{githubConnection ? (
<Button type="outline" asChild icon={<Github />}>
<a href={url} target="_blank" rel="noopener noreferrer">
Create pull request
</a>
</Button>
) : (
<Button asChild type="outline">
<Link href={`/project/${projectRef}/settings/integrations`}>Connect to GitHub</Link>
</Button>
)}
{gitlessBranching && (
<BranchSelector
type="outline"
branches={branches}
onBranchSelected={onBranchSelected}
isUpdating={isUpdating}
/>
)}
</div>
</div>
)
}
export const PreviewBranchesEmptyState = ({
onSelectCreateBranch,
}: {
onSelectCreateBranch: () => void
}) => {
return (
<div className={EMPTY_STATE_CONTAINER}>
<p>Create your first preview branch</p>
<p className="text-foreground-light text-center mb-4">
Preview branches are short-lived environments that let you safely experiment with changes to
your database schema without affecting your main database.
</p>
<div className="flex items-center space-x-2">
<DocsButton href={`${DOCS_URL}/guides/platform/branching`} />
<Button type="primary" onClick={() => onSelectCreateBranch()}>
Create your first branch
</Button>
</div>
</div>
)
}