Default types and templates

This commit is contained in:
Emma
2023-06-12 18:02:19 -06:00
parent 8fb7494464
commit a7337bd33a
10 changed files with 179 additions and 18 deletions

View File

@@ -14,8 +14,8 @@ export const SchemaViewer: FC<IProps> = ({ schema, onTypeClick }) => {
return 'Constant value:'
}
switch (field.type) {
case FieldTypes.type: return 'Type'
case FieldTypes.dice: return 'Dice'
case FieldTypes.type: return 'Type:'
case FieldTypes.dice: return 'Dice:'
default: return '';
}
}, [])
@@ -25,6 +25,19 @@ export const SchemaViewer: FC<IProps> = ({ schema, onTypeClick }) => {
{/* <div className="whitespace-pre-wrap">{JSON.stringify(schema, null, 2)}</div> */}
<div>
<p className="font-bold text-lg">{schema.name}</p>
<hr />
<p className="font-bold italic">Templates</p>
<ul>
{Object.entries(schema.templates).map(([templateKey, template]) => (
<li>
<p className="font-bold">{templateKey}</p>
<p className="font-thin text-xs">{template.type}</p>
{template.publishable && <p className="font-thin text-xs">This template can create publications</p>}
</li>
))}
</ul>
<hr />
<p className="font-bold italic">Types</p>
<ul className="rounded-lg overflow-hidden">
{Object.entries(schema.types).map(([typeKey, type]) => (
<li