diff options
Diffstat (limited to 'src/ui/Note.js')
| -rw-r--r-- | src/ui/Note.js | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/ui/Note.js b/src/ui/Note.js index 404979c..e35171a 100644 --- a/src/ui/Note.js +++ b/src/ui/Note.js @@ -4,6 +4,7 @@ import ColorHash from 'color-hash'; import { formatRelative } from 'date-fns'; import cn from 'classnames'; import css from './css'; +import { Attachment } from './Attachment'; const now = new Date(); const Time = ({ time }) => { @@ -180,7 +181,7 @@ section.type-Tombstone.ellipsis > main::after { const colors = new ColorHash({ lightness: 0.8 }); export const Note = ({ - id, type, attributedTo, published, content, + id, type, attributedTo, published, content, attachment, smallHeader = false, collapsed = false, ellipsis = false, position, onCollapse, onSelect, onSize, }) => { @@ -196,6 +197,10 @@ export const Note = ({ onSize(id, root.current.offsetWidth, root.current.offsetHeight); }); + attachment ||= []; + if (!Array.isArray(attachment)) + attachment = [attachment]; + return ( <section style={{ @@ -227,6 +232,7 @@ export const Note = ({ innerHTML={content} onClick={onClick} /> + {attachment.map(a => <Attachment {...a} />)} </section> ); }; |
