diff --git a/packages/client/src/components/mfm.ts b/packages/client/src/components/mfm.ts index 2beee156c..382b1b9e7 100644 --- a/packages/client/src/components/mfm.ts +++ b/packages/client/src/components/mfm.ts @@ -2,6 +2,7 @@ import { defineComponent, h } from "vue"; import * as mfm from "@transfem-org/sfm-js"; import type { VNode } from "vue"; import MkUrl from "@/components/global/MkUrl.vue"; +import MkTime from '@/components/global/MkTime.vue'; import MkLink from "@/components/MkLink.vue"; import MkMention from "@/components/MkMention.vue"; import MkEmoji from "@/components/global/MkEmoji.vue"; @@ -331,6 +332,23 @@ export default defineComponent({ return h('ruby', {}, [...genEl(token.children.slice(0, token.children.length - 1), scale), h('rt', text.trim())]); } } + case 'unixtime': { + const child = token.children[0]; + const unixtime = parseInt(child.type === 'text' ? child.props.text : ''); + return h('span', { + style: 'display: inline-block; font-size: 90%; border: solid 1px var(--divider); border-radius: var(--radius-ellipse); padding: 4px 10px 4px 6px;', + }, [ + h('i', { + class: 'ph-clock ph-bold ph-lg', + style: 'margin-right: 0.25em;', + }), + h(MkTime, { + key: Math.random(), + time: unixtime * 1000, + mode: 'detail', + }), + ]); + } case "small": { return h( "small",