Fixed spell descriptions

This commit is contained in:
Benjamin Sherriff
2023-10-08 18:16:03 -04:00
parent 6c3d29d705
commit 09925251dd
12 changed files with 106 additions and 51 deletions

View File

@@ -129,23 +129,53 @@ function SpellDescription({ spell }: { spell: Spell }) {
<>
{spell.description && (
<>
{spell.description.entries.map((e) =>
typeof e === 'string' ? (
<p>{parseText(e)}</p>
) : (
<>
{e.type == 'list' ? (
<ul>
{e.items.map((text) => (
<li>{parseText(text)}</li>
{spell.description.entries.map((e) => (
// typeof e === 'string' ? (
// <p>{parseText(e)}</p>
// ) : (
// <>
// {e.list ? (
// <ul>
// {e.list.map((text) => (
// <li>{parseText(text)}</li>
// ))}
// </ul>
// ) : (
// <></>
// )}
// </>
// )
<>
{e.text && <p>{parseText(e.text)}</p>}
{e.list && (
<ul>
{e.list.map((text) => (
<li>{parseText(text)}</li>
))}
</ul>
)}
{e.table && (
<table>
<thead>
<tr>
{e.table.headers.map((label) => (
<th>{label}</th>
))}
</tr>
</thead>
<tbody>
{e.table.rows.map((row) => (
<tr>
{row.map((cell) => (
<td>{parseText(cell)}</td>
))}
</tr>
))}
</ul>
) : (
<></>
)}
</>
)
)}
</tbody>
</table>
)}
</>
))}
</>
)}
</>