diff --git a/frontend/src/modals/AddActionModal.tsx b/frontend/src/modals/AddActionModal.tsx index 6ff88ae6..a2160146 100644 --- a/frontend/src/modals/AddActionModal.tsx +++ b/frontend/src/modals/AddActionModal.tsx @@ -1,7 +1,7 @@ import React, { useState } from 'react'; import { useTranslation } from 'react-i18next'; -import Exit from '../assets/exit.svg'; +import WrapperModal from './WrapperModal'; import Input from '../components/Input'; import { ActiveState } from '../models/misc'; @@ -35,67 +35,53 @@ export default function AddActionModal({ setModalState('INACTIVE'); }; + // Only render when modal is active + if (modalState !== 'ACTIVE') return null; + return ( -
setModalState('INACTIVE')} + className="sm:w-[512px]" > -
-
- -
-

- New Action -

-
- - Action Name - - setActionName(e.target.value)} - borderVariant="thin" - placeholder={'Enter name'} - /> -

- Use only letters, numbers, underscores, and hyphens (e.g., - `get_user_data`, `send-report`). -

- {functionNameError && ( -

- Invalid function name format. Use only letters, numbers, - underscores, and hyphens. -

- )} -
-
- - -
-
+
+

+ New Action +

+
+ setActionName(e.target.value)} + borderVariant="thin" + placeholder="Enter name" + label="Action Name" + /> +

+ Use only letters, numbers, underscores, and hyphens (e.g., + `get_user_data`, `send-report`). +

+ {functionNameError && ( +

+ Invalid function name format. Use only letters, numbers, + underscores, and hyphens. +

+ )}
-
-
+
+ + +
+ + ); } diff --git a/frontend/src/modals/ConfigToolModal.tsx b/frontend/src/modals/ConfigToolModal.tsx index 4a582a49..d8585899 100644 --- a/frontend/src/modals/ConfigToolModal.tsx +++ b/frontend/src/modals/ConfigToolModal.tsx @@ -45,10 +45,8 @@ export default function ConfigToolModal({ return ( setModalState('INACTIVE')} - className="sm:w-[512px]" - contentClassName="" > -
+

{t('modals.configTool.title')}

diff --git a/frontend/src/modals/CreateAPIKeyModal.tsx b/frontend/src/modals/CreateAPIKeyModal.tsx index 5c8c75b8..36ec59a8 100644 --- a/frontend/src/modals/CreateAPIKeyModal.tsx +++ b/frontend/src/modals/CreateAPIKeyModal.tsx @@ -73,7 +73,7 @@ export default function CreateAPIKeyModal({ handleFetchPrompts(); }, []); return ( - +
{t('modals.createAPIKey.label')} diff --git a/frontend/src/modals/WrapperModal.tsx b/frontend/src/modals/WrapperModal.tsx index eee205f0..b945a60a 100644 --- a/frontend/src/modals/WrapperModal.tsx +++ b/frontend/src/modals/WrapperModal.tsx @@ -14,8 +14,8 @@ export default function WrapperModal({ children, close, isPerformingTask = false, - className = 'sm:w-[512px]', // Default width, but can be overridden - contentClassName = 'p-8', // Default padding, but can be overridden + className = '', // Default width, but can be overridden + contentClassName = '', // Default padding, but can be overridden }: WrapperModalPropsType) { const modalRef = useRef(null); @@ -49,7 +49,7 @@ export default function WrapperModal({
{!isPerformingTask && ( )} -
+
{children}