Add Learn and Quiz buttons to EntryCard component

This commit is contained in:
2026-01-08 01:01:24 +01:00
parent ae669010c4
commit e741b43754

View File

@@ -7,8 +7,11 @@ interface Props {
export default function EntryCard({ entry }: Props) { export default function EntryCard({ entry }: Props) {
const { counts } = entry; const { counts } = entry;
const learnLink = `/entry/${encodeURIComponent(entry.id)}`;
const quizLink = `/quiz?mode=entry&id=${encodeURIComponent(entry.id)}`;
return ( return (
<Link to={`/entry/${encodeURIComponent(entry.id)}`} className="entry-card"> <div className="entry-card">
<div className="entry-card__title">{entry.title}</div> <div className="entry-card__title">{entry.title}</div>
<div className="entry-card__meta"> <div className="entry-card__meta">
<span className="pill">{entry.mode || 'mixed'}</span> <span className="pill">{entry.mode || 'mixed'}</span>
@@ -21,6 +24,14 @@ export default function EntryCard({ entry }: Props) {
<span>Conversation {counts.conversation}</span> <span>Conversation {counts.conversation}</span>
<span>Quiz {counts.quiz}</span> <span>Quiz {counts.quiz}</span>
</div> </div>
</Link> <div className="entry-card__actions">
<Link className="button button--ghost" to={learnLink}>
Learn
</Link>
<Link className="button" to={quizLink}>
Quiz
</Link>
</div>
</div>
); );
} }