diff --git a/frontend/src/modals/index.tsx b/frontend/src/modals/index.tsx
deleted file mode 100644
index 1dcffd6d..00000000
--- a/frontend/src/modals/index.tsx
+++ /dev/null
@@ -1,50 +0,0 @@
-import * as React from 'react';
-import { useTranslation } from 'react-i18next';
-interface ModalProps {
- handleSubmit: () => void;
- isCancellable: boolean;
- handleCancel?: () => void;
- render: () => JSX.Element;
- modalState: string;
- isError: boolean;
- errorMessage?: string;
- textDelete?: boolean;
-}
-
-const Modal = (props: ModalProps) => {
- const { t } = useTranslation();
- return (
-
- {props.render()}
-
-
- props.handleSubmit()}
- className="ml-auto h-10 w-20 rounded-3xl bg-violet-800 text-white transition-all hover:bg-violet-700 dark:text-silver"
- >
- {props.textDelete ? 'Delete' : 'Save'}
-
- {props.isCancellable && (
- props.handleCancel && props.handleCancel()}
- className="cursor-pointer rounded-3xl px-5 py-2 text-sm font-medium hover:bg-gray-100 dark:bg-transparent dark:text-light-gray dark:hover:bg-[#767183]/50"
- >
- {t('cancel')}
-
- )}
-
- {props.isError && (
-
- {props.errorMessage}
-
- )}
-
-
- );
-};
-
-export default Modal;
diff --git a/frontend/src/preferences/APIKeyModal.tsx b/frontend/src/preferences/APIKeyModal.tsx
deleted file mode 100644
index 43698fe1..00000000
--- a/frontend/src/preferences/APIKeyModal.tsx
+++ /dev/null
@@ -1,80 +0,0 @@
-import { useRef, useState } from 'react';
-import { useDispatch, useSelector } from 'react-redux';
-import { ActiveState } from '../models/misc';
-import { selectApiKey, setApiKey } from './preferenceSlice';
-import { useMediaQuery, useOutsideAlerter } from './../hooks';
-import Modal from '../modals';
-import Input from '../components/Input';
-
-export default function APIKeyModal({
- modalState,
- setModalState,
- isCancellable = true,
-}: {
- modalState: ActiveState;
- setModalState: (val: ActiveState) => void;
- isCancellable?: boolean;
-}) {
- const dispatch = useDispatch();
- const apiKey = useSelector(selectApiKey);
- const [key, setKey] = useState(apiKey);
- const [isError, setIsError] = useState(false);
- const modalRef = useRef(null);
- const { isMobile } = useMediaQuery();
-
- useOutsideAlerter(modalRef, () => {
- if (isMobile && modalState === 'ACTIVE') {
- setModalState('INACTIVE');
- }
- }, [modalState]);
-
- function handleSubmit() {
- if (key.length <= 1) {
- setIsError(true);
- } else {
- dispatch(setApiKey(key));
- setModalState('INACTIVE');
- setIsError(false);
- }
- }
-
- function handleCancel() {
- setKey(apiKey);
- setIsError(false);
- setModalState('INACTIVE');
- }
-
- return (
- {
- return (
-
- OpenAI API Key
-
- Before you can start using DocsGPT we need you to provide an API
- key for llm. Currently, we support only OpenAI but soon many more.
- You can find it here.
-
- setKey(e.target.value)}
- >
-
- );
- }}
- />
- );
-}