Fixes #51 Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PPmy3tPq869XDW4njjVaKA
148 lines
5.4 KiB
TypeScript
148 lines
5.4 KiB
TypeScript
import React, { useCallback, useRef, useState } from 'react';
|
|
import { Box, Button, color, config, Icon, Icons, Text } from 'folds';
|
|
import { QRCodeSVG, QRCodeCanvas } from 'qrcode.react';
|
|
import { SequenceCard } from '../../../components/sequence-card';
|
|
import { SequenceCardStyle } from '../../room-settings/styles.css';
|
|
import { SettingTile } from '../../../components/setting-tile';
|
|
import { CutoutCard } from '../../../components/cutout-card';
|
|
import { useRoom } from '../../../hooks/useRoom';
|
|
import { getMatrixToRoom } from '../../../plugins/matrix-to';
|
|
import { getViaServers } from '../../../plugins/via-servers';
|
|
import { useSaveFile } from '../../../hooks/useSaveFile';
|
|
|
|
// Filesystem-safe basename from an arbitrary room name. Denylist only the
|
|
// path-hostile / control characters so Unicode names (CJK, Cyrillic, emoji, …)
|
|
// survive instead of being stripped to the 'room' fallback. Collapse whitespace,
|
|
// trim separator runs, and cap length to stay under filesystem name limits.
|
|
// eslint-disable-next-line no-control-regex
|
|
const UNSAFE_FILENAME = /[/\\:*?"<>| |