Full refactor to Typescript

This commit is contained in:
2022-11-17 19:19:33 +01:00
parent de3f10b3ee
commit ffd3c99292
19 changed files with 180 additions and 95 deletions
+27
View File
@@ -0,0 +1,27 @@
import { Markdown } from './Markdown'
type Props = {
id: string
content: string
solutionsCount?: number
}
export const Problem = ({ id, content, solutionsCount }: Props) => {
return (
<div class="problem">
<div class="problem-header">
<div class="problem-title">
<a href={`/problem/${id}`}>Problema {id}</a>
</div>
</div>
<div class="problem-content">
<Markdown source={content} />
</div>
{solutionsCount && solutionsCount > 0 && (
<div class="problem-footer">
{solutionsCount} soluzion{solutionsCount === 1 ? 'e' : 'i'}
</div>
)}
</div>
)
}