feat(hololake): ship language platform 0.7.0
This commit is contained in:
parent
a360982a9b
commit
5105ec5e32
47 changed files with 4566 additions and 398 deletions
|
|
@ -1,6 +1,7 @@
|
|||
import { useState, useEffect, useMemo } from 'react';
|
||||
import { DocContent } from '../api';
|
||||
import { marked } from 'marked';
|
||||
import { cleanDisplayText } from '../presentation';
|
||||
|
||||
interface Props {
|
||||
doc: DocContent;
|
||||
|
|
@ -37,13 +38,14 @@ export function Editor({ doc, onSave }: Props) {
|
|||
setBody(doc.body);
|
||||
setEditing(false);
|
||||
};
|
||||
const displayPath = doc.meta.id.split('/').map(cleanDisplayText).join(' / ');
|
||||
|
||||
return (
|
||||
<div className="kb-editor">
|
||||
<div className="kb-page-symbol" aria-hidden="true">◇</div>
|
||||
{/* 元信息栏 */}
|
||||
<div className="kb-editor-meta">
|
||||
<span className="kb-editor-path">HoloLake / {doc.meta.id}</span>
|
||||
<span className="kb-editor-path">HoloLake / {displayPath}</span>
|
||||
<span className="kb-editor-date">
|
||||
更新于 {new Date(doc.meta.updatedAt).toLocaleString('zh-CN')}
|
||||
</span>
|
||||
|
|
@ -60,7 +62,7 @@ export function Editor({ doc, onSave }: Props) {
|
|||
/>
|
||||
) : (
|
||||
<h1 className="kb-editor-title" onClick={() => setEditing(true)}>
|
||||
{doc.meta.title}
|
||||
{cleanDisplayText(doc.meta.title)}
|
||||
</h1>
|
||||
)}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue