diff --git a/app/salesGPT/components/employeeSelect.tsx b/app/salesGPT/components/employeeSelect.tsx index a4a3a18feb2..682495337b2 100644 --- a/app/salesGPT/components/employeeSelect.tsx +++ b/app/salesGPT/components/employeeSelect.tsx @@ -76,6 +76,7 @@ function EmployeeSelect({ return ( updateValue(InputListValue.index, e.target.value)} + /> + + } + onClick={() => deleteValue(InputListValue.value)} + /> + + ); +}; + +export default ListInput; diff --git a/app/salesGPT/components/salesGPT.tsx b/app/salesGPT/components/salesGPT.tsx index 10fc58d10d1..647250a1af2 100644 --- a/app/salesGPT/components/salesGPT.tsx +++ b/app/salesGPT/components/salesGPT.tsx @@ -1,7 +1,12 @@ "use client"; import React, { useEffect, useState } from "react"; import { Loading } from "@/app/components/chatHomepage"; -import { EmployeeItem, HelpOption, HelpOptionValue } from "../types"; +import { + EmployeeItem, + HelpOption, + HelpOptionValue, + InputListValue, +} from "../types"; import EmployeeCVSummary from "./employeeCVSummary"; import { ErrorBoundary } from "../../components/error"; import { @@ -26,6 +31,8 @@ import RightPane from "./rightPane"; import RequirementsList from "./requirementsList"; import { SALES_GPT_MASK } from "@/app/masks/no"; import { projectExperienceToText } from "@/app/function/ProjectExperienceToText"; +import InputList from "./inputLIst/inputList"; +import { SalesGPTIconButton } from "./salesGPTIconButton"; const availableHelp: HelpOption[] = [ { @@ -55,7 +62,6 @@ function _SalesGPT() { EmployeeItem | undefined >(undefined); - const [requirementText, setRequirementText] = useState(""); const [requirementResponse, setRequirementResponse] = useState< RequirementResponse[] >([]); @@ -64,13 +70,17 @@ function _SalesGPT() { const [isAnalysisLoading, setIsAnalysisLoading] = useState(false); const [selectedHelp, setSelectedHelp] = useState( - undefined, + availableHelp[0], ); const [showCVSummary, setShowCVSummary] = useState(false); const [showRequirementsList, setShowRequirementsList] = useState(false); const [concise, setConcise] = useState(false); + const [inputListValues, setInputListValues] = useState([ + { index: 0, value: "" }, + ]); + function handleSelectEmployee(newValue: EmployeeItem | undefined): void { setSelectedEmployee(newValue); // TODO: Handle query params later @@ -202,7 +212,9 @@ function _SalesGPT() { async function handleAnalyseButtonClick(): Promise { setIsAnalysisLoading(true); setRequirementResponse([]); - const requirements = requirementText.split("\n").filter((s) => s.length); + const requirements = inputListValues.map( + (requirement) => requirement.value, + ); const employeeAlias = aliasFromEmail(selectedEmployee?.email); if (selectedHelp?.value == HelpOptionValue.RequirementList) { @@ -260,74 +272,81 @@ function _SalesGPT() { >
-
- - -
-
- - -
-
- - -
-
- - -
-
- - setConcise(event.target.checked)} - /> -
-
- -
-
- -
+
{ + e.preventDefault(); + }} + > +
+ + +
+
+ +
{ + e.preventDefault(); + handleAnalyseButtonClick(); + }} + > +
+ + +
+ +
+ + +
+ + {/* TODO: Kanskje dele opp koden så vi har en getField som rendrer basert på selectedHelp. lettere hvis vi endrer på value */} + {selectedHelp?.value !== "requirementlist" && ( +
+ + +
+ )} +
+ +
+
+ +
+
void; + icon?: JSX.Element; + type?: ButtonType; + text?: string; + bordered?: boolean; + shadow?: boolean; + className?: string; + title?: string; + disabled?: boolean; + tabIndex?: number; + autoFocus?: boolean; + role?: "button" | "submit" | "reset" | undefined; +} + +export function SalesGPTIconButton({ + onClick, + icon, + type, + text, + bordered, + shadow, + className, + title, + disabled, + tabIndex, + autoFocus, + role = "button", +}: SalesGPTIconButtonProps) { + return ( + + ); +} diff --git a/app/salesGPT/types.ts b/app/salesGPT/types.ts index 4affdd850d6..af5fdec7f0d 100644 --- a/app/salesGPT/types.ts +++ b/app/salesGPT/types.ts @@ -78,3 +78,8 @@ export type HelpOption = { label: string; value: HelpOptionValue | undefined; }; + +export type InputListValue = { + index: number; + value: string; +};