66} from "@/components/ui/dropdown-menu"
77import { Button , ButtonProps } from "@/components/ui/button"
88import { forwardRef , useState } from "react"
9- import { useConfig } from "@/hooks/useConfig "
10- import { ConfigEssential } from "@/types"
9+ import useSettings from "@/hooks/useSetting "
10+ import { ModelConfig } from "@/types"
1111import { Check , Clipboard } from "lucide-react"
1212import { toast } from "sonner"
1313
@@ -21,15 +21,15 @@ enum OSTypes {
2121
2222export const InstallCommandsMenu = forwardRef < HTMLButtonElement , ButtonProps > ( ( props , ref ) => {
2323 const [ copy , setCopy ] = useState ( false ) ;
24- const { config } = useConfig ( ) ;
24+ const settings = useSettings ( ) ;
2525 const { t } = useTranslation ( ) ;
2626
2727 const switchState = async ( type : number ) => {
2828 if ( ! copy ) {
2929 try {
3030 setCopy ( true ) ;
31- if ( config )
32- await navigator . clipboard . writeText ( generateCommand ( type , config ) ) ;
31+ if ( settings )
32+ await navigator . clipboard . writeText ( generateCommand ( type , settings ) ) ;
3333 } catch ( e ) {
3434 console . error ( e ) ;
3535 toast ( t ( "Error" ) , {
@@ -60,7 +60,7 @@ export const InstallCommandsMenu = forwardRef<HTMLButtonElement, ButtonProps>((p
6060 ) ;
6161} )
6262
63- const generateCommand = ( type : number , { agent_secret_key, install_host, listen_port, tls } : ConfigEssential ) => {
63+ const generateCommand = ( type : number , { agent_secret_key, install_host, listen_port, tls } : ModelConfig ) => {
6464 if ( ! install_host )
6565 throw new Error ( "You have not specify the installed host." ) ;
6666
0 commit comments