diff --git a/components/dashboard/mariadb/environment/show-mariadb-environment.tsx b/components/dashboard/mariadb/environment/show-mariadb-environment.tsx index 807dcae07..61f64cd8c 100644 --- a/components/dashboard/mariadb/environment/show-mariadb-environment.tsx +++ b/components/dashboard/mariadb/environment/show-mariadb-environment.tsx @@ -14,9 +14,11 @@ import { FormItem, FormMessage, } from "@/components/ui/form"; +import { Toggle } from "@/components/ui/toggle"; import { api } from "@/utils/api"; import { zodResolver } from "@hookform/resolvers/zod"; -import React, { useEffect } from "react"; +import { EyeIcon, EyeOffIcon } from "lucide-react"; +import React, { useEffect, useState } from "react"; import { useForm } from "react-hook-form"; import { toast } from "sonner"; import { z } from "zod"; @@ -32,6 +34,7 @@ interface Props { } export const ShowMariadbEnvironment = ({ mariadbId }: Props) => { + const [isEnvVisible, setIsEnvVisible] = useState(true); const { mutateAsync, isLoading } = api.mariadb.saveEnvironment.useMutation(); const { data, refetch } = api.mariadb.one.useQuery( @@ -74,11 +77,26 @@ export const ShowMariadbEnvironment = ({ mariadbId }: Props) => { return (
- - Environment Settings - - You can add environment variables to your database. - + {" "} + +
+ Environment Settings + + You can add environment variables to your resource. + +
+ + + {isEnvVisible ? ( + + ) : ( + + )} +
@@ -95,6 +113,7 @@ export const ShowMariadbEnvironment = ({ mariadbId }: Props) => { { + const [isEnvVisible, setIsEnvVisible] = useState(true); const { mutateAsync, isLoading } = api.mongo.saveEnvironment.useMutation(); const { data, refetch } = api.mongo.one.useQuery( @@ -74,11 +77,25 @@ export const ShowMongoEnvironment = ({ mongoId }: Props) => { return (
- - Environment Settings - - You can add environment variables to your database. - + +
+ Environment Settings + + You can add environment variables to your resource. + +
+ + + {isEnvVisible ? ( + + ) : ( + + )} +
@@ -95,6 +112,7 @@ export const ShowMongoEnvironment = ({ mongoId }: Props) => { { + const [isEnvVisible, setIsEnvVisible] = useState(true); const { mutateAsync, isLoading } = api.mysql.saveEnvironment.useMutation(); const { data, refetch } = api.mysql.one.useQuery( @@ -74,11 +77,25 @@ export const ShowMysqlEnvironment = ({ mysqlId }: Props) => { return (
- - Environment Settings - - You can add environment variables to your database. - + +
+ Environment Settings + + You can add environment variables to your resource. + +
+ + + {isEnvVisible ? ( + + ) : ( + + )} +
@@ -95,6 +112,7 @@ export const ShowMysqlEnvironment = ({ mysqlId }: Props) => { { + const [isEnvVisible, setIsEnvVisible] = useState(true); const { mutateAsync, isLoading } = api.postgres.saveEnvironment.useMutation(); const { data, refetch } = api.postgres.one.useQuery( @@ -74,11 +77,25 @@ export const ShowPostgresEnvironment = ({ postgresId }: Props) => { return (
- - Environment Settings - - You can add environment variables to your database. - + +
+ Environment Settings + + You can add environment variables to your resource. + +
+ + + {isEnvVisible ? ( + + ) : ( + + )} +
@@ -95,6 +112,7 @@ export const ShowPostgresEnvironment = ({ postgresId }: Props) => { { + const [isEnvVisible, setIsEnvVisible] = useState(true); const { mutateAsync, isLoading } = api.redis.saveEnvironment.useMutation(); const { data, refetch } = api.redis.one.useQuery( @@ -74,11 +77,25 @@ export const ShowRedisEnvironment = ({ redisId }: Props) => { return (
- - Environment Settings - - You can add environment variables to your database. - + +
+ Environment Settings + + You can add environment variables to your resource. + +
+ + + {isEnvVisible ? ( + + ) : ( + + )} +
@@ -95,6 +112,7 @@ export const ShowRedisEnvironment = ({ redisId }: Props) => {