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
+36
View File
@@ -0,0 +1,36 @@
import { ProblemId, SolutionStatus, UserId } from '../../shared/model'
import { Markdown } from './Markdown'
type Props = {
sentBy?: UserId
forProblem: ProblemId
content: string
status?: SolutionStatus
}
export const Solution = ({ sentBy, forProblem, content }: Props) => {
return (
<div class="solution">
<div class="solution-header">
<div>
Soluzione
{sentBy && (
<>
{' '}
di <a href={`/user/${sentBy}`}>@{sentBy}</a>
</>
)}
{forProblem && (
<>
{' '}
per il <a href={`/problem/${forProblem}`}>Problema {forProblem}</a>
</>
)}
</div>
</div>
<div class="solution-content">
<Markdown source={content} />
</div>
</div>
)
}