Skip to content
Snippets Groups Projects
Commit 29070864 authored by xaralis's avatar xaralis
Browse files

feat: render program entry description as markdown

parent bf2db416
No related branches found
No related tags found
No related merge requests found
......@@ -8,6 +8,7 @@ import Button from "components/Button";
import Chip from "components/Chip";
import ModalConfirm from "components/modals/ModalConfirm";
import { useActionState, useItemActionConfirm } from "hooks";
import { markdownConverter } from "markdown";
import { AuthStore, ProgramStore } from "stores";
const Schedule = () => {
......@@ -49,6 +50,11 @@ const Schedule = () => {
const isCurrent = id === currentId;
const entry = items[id];
const fullTitle = `${entry.number}. ${entry.title}`;
const htmlContent = !!entry.description
? {
__html: markdownConverter.makeHtml(entry.description),
}
: null;
return (
<div
className="flex flex-col md:flex-row my-4 duration-300 text-black"
......@@ -78,10 +84,11 @@ const Schedule = () => {
<strong>Navrhovatel:</strong>
<span>{entry.proposer}</span>
</div>
{entry.description && (
<p className="mt-2 leading-tight max-w-3xl">
{entry.description}
</p>
{htmlContent && (
<div
className="mt-2 leading-tight max-w-3xl content-block"
dangerouslySetInnerHTML={htmlContent}
/>
)}
{isAuthenticated &&
user.role === "chairman" &&
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment