diff --git a/agenta-web/src/components/pages/evaluations/EvaluationErrorModal/EvaluationErrorModal.tsx b/agenta-web/src/components/pages/evaluations/EvaluationErrorModal/EvaluationErrorModal.tsx new file mode 100644 index 0000000000..4262353296 --- /dev/null +++ b/agenta-web/src/components/pages/evaluations/EvaluationErrorModal/EvaluationErrorModal.tsx @@ -0,0 +1,61 @@ +import {JSSTheme} from "@/lib/Types" +import {ExclamationCircleOutlined} from "@ant-design/icons" +import {Modal, Typography} from "antd" +import React from "react" +import {createUseStyles} from "react-jss" + +interface EvaluationErrorModalProps { + isErrorModalOpen: boolean + setIsErrorModalOpen: (value: React.SetStateAction) => void + modalErrorMsg: { + message: string + stackTrace: string + } +} + +const useStyles = createUseStyles((theme: JSSTheme) => ({ + errModalStackTrace: { + "& code": { + display: "block", + }, + }, +})) + +const EvaluationErrorModal = ({ + isErrorModalOpen, + setIsErrorModalOpen, + modalErrorMsg, +}: EvaluationErrorModalProps) => { + const classes = useStyles() + + return ( + + + Error + + } + onCancel={() => setIsErrorModalOpen(false)} + > + + Failed to invoke the LLM application with the following exception: + + {modalErrorMsg.message && ( + + {modalErrorMsg.message} + + )} + {modalErrorMsg.stackTrace && ( + + {modalErrorMsg.stackTrace} + + )} + + ) +} + +export default EvaluationErrorModal