diff --git a/frontend/src/container/OrganizationSettings/DisplayName/index.tsx b/frontend/src/container/OrganizationSettings/DisplayName/index.tsx index 1497232fee..135565447a 100644 --- a/frontend/src/container/OrganizationSettings/DisplayName/index.tsx +++ b/frontend/src/container/OrganizationSettings/DisplayName/index.tsx @@ -1,4 +1,4 @@ -import { Button, Input, notification, Space, Typography } from 'antd'; +import { Button, Form, Input, notification } from 'antd'; import editOrg from 'api/user/editOrg'; import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; @@ -14,14 +14,15 @@ function DisplayName({ id: orgId, isAnonymous, }: DisplayNameProps): JSX.Element { + const [form] = Form.useForm(); + const { t } = useTranslation(['organizationsettings', 'common']); const { org } = useSelector((state) => state.app); const { name } = (org || [])[index]; - const [orgName, setOrgName] = useState(name); const [isLoading, setIsLoading] = useState(false); const dispatch = useDispatch>(); - const onClickHandler = async (): Promise => { + const onSubmit = async ({ name: orgName }: OnSubmitProps): Promise => { try { setIsLoading(true); const { statusCode, error } = await editOrg({ @@ -67,26 +68,22 @@ function DisplayName({ } return ( - - {t('display_name')} - - setOrgName(e.target.value)} - size="large" - placeholder={t('signoz')} - disabled={isLoading} - /> - - - + + ); } @@ -96,4 +93,8 @@ interface DisplayNameProps { isAnonymous: boolean; } +interface OnSubmitProps { + name: string; +} + export default DisplayName;