import { FC } from "react"; import { Controller, useForm } from "react-hook-form"; // ui import { Button, Input } from "@plane/ui"; // types import { IInstance, IInstanceAdmin } from "types/instance"; // hooks import useToast from "hooks/use-toast"; import { useMobxStore } from "lib/mobx/store-provider"; export interface IInstanceGeneralForm { instance: IInstance; instanceAdmins: IInstanceAdmin[]; } export interface GeneralFormValues { instance_name: string; // is_telemetry_enabled: boolean; } export const InstanceGeneralForm: FC = (props) => { const { instance, instanceAdmins } = props; // store const { instance: instanceStore } = useMobxStore(); // toast const { setToastAlert } = useToast(); // form data const { handleSubmit, control, formState: { errors, isSubmitting }, } = useForm({ defaultValues: { instance_name: instance.instance_name, // is_telemetry_enabled: instance.is_telemetry_enabled, }, }); const onSubmit = async (formData: GeneralFormValues) => { const payload: Partial = { ...formData }; await instanceStore .updateInstanceInfo(payload) .then(() => setToastAlert({ title: "Success", type: "success", message: "Settings updated successfully", }) ) .catch((err) => console.error(err)); }; return ( <>

Name of instance

( )} />

Admin email

Instance ID

{/*
Share anonymous usage instance
Help us understand how you use Plane so we can build better for you.
} />
*/}
); };