import { FC } from "react"; import { Controller, useForm } from "react-hook-form"; import { IInstance, IInstanceAdmin } from "@plane/types"; // ui import { Button, Input, TOAST_TYPE, setToast } from "@plane/ui"; // types import { useApplication } from "@/hooks/store"; // hooks 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 hooks const { instance: instanceStore } = useApplication(); // 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(() => setToast({ title: "Success", type: TOAST_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.
} />
*/}
); };