2026-07-10 15:57:19 -04:00
|
|
|
import React, { useCallback, useRef, useState } from 'react';
|
2026-07-10 16:03:04 -04:00
|
|
|
import { Box, Button, color, config, Icon, Icons, Text } from 'folds';
|
2026-07-10 15:57:19 -04:00
|
|
|
import { QRCodeSVG, QRCodeCanvas } from 'qrcode.react';
|
2026-06-02 19:31:30 -04:00
|
|
|
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';
|
2026-09-12 20:28:42 -04:00
|
|
|
import { getViaServers } from '../../../plugins/via-servers';
|
2026-07-10 15:57:19 -04:00
|
|
|
import { useSaveFile } from '../../../hooks/useSaveFile';
|
|
|
|
|
|
2026-07-10 16:03:04 -04:00
|
|
|
// 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 = /[/\\:*?"<>| |