/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import * as React from 'react'; import { useMemo, useState } from 'react'; import { isDevPlayground } from './appSettings'; import { useSettings } from './context/SettingsContext'; import Switch from './ui/Switch'; export default function Settings(): JSX.Element { const windowLocation = window.location; const { setOption, settings: { measureTypingPerf, isCollab, isRichText, isCharLimit, isCharLimitUtf8, isAutocomplete, // showTreeView, showNestedEditorTreeView, disableBeforeInput, }, } = useSettings(); const [showSettings, setShowSettings] = useState(false); const [isSplitScreen, search] = useMemo(() => { const parentWindow = window.parent; const _search = windowLocation.search; const _isSplitScreen = parentWindow && parentWindow.location.pathname === '/split/'; return [_isSplitScreen, _search]; }, [windowLocation]); return ( <>