Skip to content

Commit

Permalink
Fix indentation lit
Browse files Browse the repository at this point in the history
  • Loading branch information
ferdeleong committed Sep 30, 2024
1 parent 69d63c7 commit 51db742
Showing 1 changed file with 20 additions and 18 deletions.
38 changes: 20 additions & 18 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ function App() {
performSpellcheck(resumeData);
}
};

const performSpellcheck = (data) => {
fetch(`${API_URL}/resume/spellcheck`, {
method: "POST",
Expand All @@ -150,7 +150,7 @@ function App() {
.then((response) => response.json())
.then((spellcheckData) => setSpellcheckResults(spellcheckData))
.catch((error) => console.error("Spellcheck error:", error));
};
};

return (
<div className="App">
Expand Down Expand Up @@ -200,22 +200,24 @@ function App() {
<button onClick={handleSpellcheck}>Check Spelling</button>

{spellcheckResults && (
<div>
<h2>Spellcheck Suggestions:</h2>
{spellcheckResults
.filter((result) => result.after.length > 0)
.map((result, index) => (
<div key={index}>
<p><strong>Original:</strong> {result.before}</p>
<p><strong>Suggestions:</strong> {result.after.join(", ")}</p>
</div>
))}
{spellcheckResults.filter((result) => result.after.length > 0).length === 0 && (
<p>No spelling mistakes found!</p>
)}
</div>
)}

<div>
<h2>Spellcheck Suggestions:</h2>
{spellcheckResults
.filter((result) => result.after.length > 0)
.map((result, index) => (
<div key={index}>
<p>
<strong>Original:</strong> {result.before}
</p>
<p>
<strong>Suggestions:</strong> {result.after.join(", ")}
</p>
</div>
))}
{spellcheckResults.filter((result) => result.after.length > 0)
.length === 0 && <p>No spelling mistakes found!</p>}
</div>
)}

<br />
<br />
Expand Down

0 comments on commit 51db742

Please sign in to comment.