Skip to content

Commit

Permalink
database type
Browse files Browse the repository at this point in the history
  • Loading branch information
liuliu-dev committed Dec 4, 2024
1 parent 74ce44a commit 37c6e40
Showing 1 changed file with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,18 @@ import {
Loader,
} from "@dolthub/react-components";
import { useReactiveWidth } from "@dolthub/react-hooks";
import { useAddRemoteMutation } from "@gen/graphql-types";
import {
useAddRemoteMutation,
useDoltDatabaseDetailsQuery,
} from "@gen/graphql-types";
import useMutation from "@hooks/useMutation";
import { DatabaseParams } from "@lib/params";
import { refetchRemoteQueries } from "@lib/refetchQueries";
import { remotes } from "@lib/urls";
import { useRouter } from "next/router";
import { SyntheticEvent, useState } from "react";
import Link from "@components/links/Link";
import { getDatabaseType } from "@components/DatabaseTypeLabel";
import css from "./index.module.css";

type Props = {
Expand All @@ -21,6 +25,12 @@ type Props = {

export default function AddRemoteForm(props: Props): JSX.Element {
const router = useRouter();
const { data: databaseDetails, loading: databaseDetailsLoading } =
useDoltDatabaseDetailsQuery();
const type = getDatabaseType(
databaseDetails?.doltDatabaseDetails.type ?? undefined,
!!databaseDetails?.doltDatabaseDetails.isDolt,
);
const [remoteName, setRemoteName] = useState("");
const [remoteUrl, setRemoteUrl] = useState("");
const {
Expand Down Expand Up @@ -79,15 +89,15 @@ export default function AddRemoteForm(props: Props): JSX.Element {
</Button>
</ButtonsWithError>
<p className={css.text}>
A remote is a [Dolt|Doltgres] database in another location, usually
on a different, network accessible host. To learn more about
configuring a remote for your database, see our{" "}
A remote is a {type} database in another location, usually on a
different, network accessible host. To learn more about configuring
a remote for your database, see our{" "}
<Link href="https://docs.dolthub.com/concepts/dolt/git/remotes">
documentation
</Link>
</p>
</div>
<Loader loaded={!loading} />
<Loader loaded={!loading && !databaseDetailsLoading} />
</form>
</div>
);
Expand Down

0 comments on commit 37c6e40

Please sign in to comment.