feat(web): show the space validity period in the top bar

This commit is contained in:
justme committed 2026-10-16 18:30:59 +08:00
1 parent 6d6490055e
commit 915992776d
1 file changed
+2
+2
View File
@@ -1,3 +1,4 @@
import { formatRemaining } from '@/lib/format';
import { useWorkspace } from '@/store/workspace'; import { useWorkspace } from '@/store/workspace';
import { Button } from '@/ui/Button'; import { Button } from '@/ui/Button';
import { Icon } from '@/ui/Icon'; import { Icon } from '@/ui/Icon';
@@ -34,6 +35,7 @@ export function TopBar({ onBack, onOpenPanel, onOpenSettings, onOpenMembers, onI
<span className={styles.name}>{channel?.name || `${channel?.id.slice(0, 8)}…`}</span> <span className={styles.name}>{channel?.name || `${channel?.id.slice(0, 8)}…`}</span>
{channel?.name ? <span className={styles.idSuffix}>{channel.id.slice(0, 8)}…</span> : null} {channel?.name ? <span className={styles.idSuffix}>{channel.id.slice(0, 8)}…</span> : null}
{channel?.creatorAccount ? <span className={styles.idSuffix}>创建者 {channel.creatorAccount}</span> : null} {channel?.creatorAccount ? <span className={styles.idSuffix}>创建者 {channel.creatorAccount}</span> : null}
{channel?.expiresAt ? <span className={styles.idSuffix} title={`到期时间 ${new Date(channel.expiresAt).toLocaleString('zh-CN', { hour12: false })}。空间有新内容时会自动顺延`}>{formatRemaining(channel.expiresAt).replace(/^剩 /, '有效期 ')}</span> : null}
{raw ? ( {raw ? (
<span className={styles.badgeWarn}>明文 · 服务端可见</span> <span className={styles.badgeWarn}>明文 · 服务端可见</span>
) : ( ) : (