@@ -9,7 +9,7 @@ import { ConnectionTemplateDictionary } from "@/components/connection-config-edi
99import { Button } from "@/components/orbit/button" ;
1010import { getDatabaseFriendlyName } from "@/components/resource-card/utils" ;
1111import { ArrowLeft , ArrowRight , FloppyDisk } from "@phosphor-icons/react" ;
12- import { useParams , useRouter } from "next/navigation" ;
12+ import { useParams , useRouter , useSearchParams } from "next/navigation" ;
1313import { useCallback , useMemo , useState } from "react" ;
1414import { mutate } from "swr" ;
1515import { createLocalConnection } from "../../hooks" ;
@@ -19,7 +19,15 @@ export const runtime = "edge";
1919export default function LocalNewBasePage ( ) {
2020 const { driver } = useParams < { driver : string } > ( ) ;
2121 const router = useRouter ( ) ;
22- const [ value , setValue ] = useState < CommonConnectionConfig > ( { name : "" } ) ;
22+ const searchParams = useSearchParams ( )
23+ const [ value , setValue ] = useState < CommonConnectionConfig > ( {
24+ name : "" ,
25+ host : searchParams . get ( "url" ) ?? "" ,
26+ ...( driver === "starbase" ? {
27+ starbase_type : searchParams . get ( "type" ) ?? "internal"
28+ } : { } ) ,
29+ token : searchParams . get ( "access-key" ) ?? ""
30+ } ) ;
2331 const [ loading , setLoading ] = useState ( false ) ;
2432 const [ validateErrors , setValidateErrors ] = useState < Record < string , string > > (
2533 { }
0 commit comments