Skip to content

Commit

Permalink
show checked ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
chakkun1121 committed Feb 1, 2024
1 parent 6c86ca4 commit 4249864
Showing 1 changed file with 37 additions and 14 deletions.
51 changes: 37 additions & 14 deletions app/(app)/flashCard/cardResult.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,43 @@ export default function CardResult({
}) {
return (
<div className="grid p-4 w-full max-w-7xl mx-auto gap-4">
<div>
<div>
<h2>チェック率</h2>
<p>
英語→日本語:
{Math.round(
((results.check["en-ja"]?.length || 0) /
fileContent.content.length) *
100
)}
%
</p>
<p>
日本語→英語:
{Math.round(
((results.check["ja-en"]?.length || 0) /
fileContent.content.length) *
100
)}
%
</p>
</div>
</div>
<nav className="flex-none flex gap-4">
<button
onClick={() => window.location.reload()}
className="p-2 rounded bg-gray-100 hover:bg-gray-200"
>
もう一度
</button>
<button
onClick={() => window.close()}
className="p-2 rounded bg-gray-100 hover:bg-gray-200"
>
閉じる
</button>
</nav>
<table className="w-full rounded">
<caption className="text-heading-S">結果</caption>
<thead className="bg-gray-200">
Expand Down Expand Up @@ -65,20 +102,6 @@ export default function CardResult({
})}
</tbody>
</table>
<nav className="flex-none flex gap-4">
<button
onClick={() => window.location.reload()}
className="p-2 rounded bg-gray-100 hover:bg-gray-200"
>
もう一度
</button>
<button
onClick={() => window.close()}
className="p-2 rounded bg-gray-100 hover:bg-gray-200"
>
閉じる
</button>
</nav>
</div>
);
}

0 comments on commit 4249864

Please sign in to comment.