import { useChannels } from '@/store/channels'; import { spaceSeqKey, useReadState } from '@/store/readState'; import { useSpaceReads } from './useThreadReads'; import { useAccount } from '@/store/account'; import { useWorkspace } from '@/store/workspace'; import { channelPath, navigate } from '@/app/navigation'; import { Icon } from '@/ui/Icon'; import styles from './SpaceRail.module.css'; interface RailProps { id?: string; onCreate: () => void; onJoin: () => void } /** 空间切换:桌面是最左一列窄栏,手机是横向一排方块 */ export function SpaceRail({ id, onCreate, onJoin }: RailProps) { const channels = useChannels((s) => s.list); const username = useAccount((s) => s.username); const reads = useReadState((s) => s.reads); useSpaceReads(id); return ; } /** 频道列表顶部:空间名与加密状态。空间设置入口在顶栏 */ export function SpaceHeader() { const channel = useWorkspace((s) => s.channel); const name = channel?.name || `${channel?.id.slice(0, 8) ?? ''}…`; return