Skip to content

Commit

Permalink
Fixed prompt input merge conflict
Browse files Browse the repository at this point in the history
  • Loading branch information
RowenTey committed Jan 20, 2024
1 parent 0628bbe commit 1195828
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 16 deletions.
7 changes: 7 additions & 0 deletions client/src/components/PromptInput/PromptInput.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@ export default function PromptInput() {
const [error, setError] = useState("");
const dispatch = useDispatch();

const handleInputChange = (e) => {
setInputValue(e.target.value);
};
const handleInputChange = (e) => {
setInputValue(e.target.value);
};
Expand Down Expand Up @@ -65,6 +68,10 @@ export default function PromptInput() {
setInputValue("");
setError("");
};
// Reset the input value and error state
setInputValue("");
setError("");
};

return (
<div
Expand Down
41 changes: 25 additions & 16 deletions client/src/pages/QueryPage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,32 @@ import { Grid } from "@mui/material";
import CodeEditor from "../components/CodeEditor/CodeEditor";
import PromptInput from "../components/PromptInput/PromptInput";
import Output from "../components/Output/Output";
import { useState } from "react";

const myMap = new Map([
["code", [6, 6]],
["text", [5, 7]],
]);

export default function QueryPage() {
return (
<>
<h1 style={{ textAlign: "center" }}>Monaco Editor Example</h1>
const [type, setType] = useState("text");
const [length1, length2] = myMap.get(type);

return (
<>
<h1 style={{ textAlign: "center" }}>Monaco Editor Example</h1>

<div style={{ paddingLeft: "1rem", paddingRight: "1rem" }}>
<Grid container spacing={2}>
<Grid item xs={6}>
<CodeEditor defaultCode={"# Paste/Enter your code here"} />
{/* <PromptInput /> */}
</Grid>
<Grid item xs={6}>
<Output />
</Grid>
</Grid>
</div>
</>
);
<div style={{ paddingLeft: "1rem", paddingRight: "1rem" }}>
<Grid container spacing={2}>
<Grid item xs={length1}>
{/* <CodeEditor defaultCode={"# Paste/Enter your code here"} /> */}
<PromptInput />
</Grid>
<Grid item xs={length2}>
<Output />
</Grid>
</Grid>
</div>
</>
);
}

0 comments on commit 1195828

Please sign in to comment.