feat: integrate client and server sharing workflows

This commit is contained in:
justme committed 2026-10-02 10:49:45 +08:00
1 parent 42b93ae2d8
commit 7406e2fe37
101 files changed
+3153 -253

No files matched your search

+5 -1
View File
@@ -18,13 +18,15 @@ const noop = () => {};
export function ShareView() {
const share = useShareSession((s) => s.share);
const ids = useShareSession((s) => s.order);
const integrityError = useShareSession((s) => s.integrityError);
const error = useShareSession((s) => s.error);
const download = useDownload();
const [sheetId, setSheetId] = useState<string>();
const [showQr, setShowQr] = useState(true);
const closeSheet = useCallback(() => setSheetId(undefined), []);
if (!share) return null;
const remaining = formatRemaining(share.createdAt + share.ttlSeconds * 1000);
const remaining = formatRemaining(share.expiresAt);
async function downloadAll() {
const { byId } = useShareSession.getState();
@@ -42,6 +44,8 @@ export function ShareView() {
badge={<span className={styles.badge}><Icon name="lock" size={12} /> 已封存 · 只读</span>}
/>
<main className={styles.main}>
{integrityError ? <p className={styles.error} role="alert">{integrityError}</p> : null}
{error ? <p className={styles.error} role="alert">{error}</p> : null}
{share.mine ? (
<section className={styles.share} aria-label="分享给别人">
<h2 className={styles.h}>分享给别人</h2>