mirror of
https://github.com/CherryHQ/cherry-studio.git
synced 2025-12-28 05:11:24 +08:00
fix(TextFilePreview): make editor read-only but can be copied
This commit is contained in:
parent
53e38ed1aa
commit
a6c2441156
@ -1,3 +1,4 @@
|
||||
import { EditorState } from '@codemirror/state'
|
||||
import { Modal } from 'antd'
|
||||
import { useState } from 'react'
|
||||
import styled from 'styled-components'
|
||||
@ -55,12 +56,12 @@ const PopupContainer: React.FC<Props> = ({ text, title, extension, resolve }) =>
|
||||
footer={null}>
|
||||
{extension !== undefined ? (
|
||||
<Editor
|
||||
editable={false}
|
||||
expanded={false}
|
||||
height="100%"
|
||||
style={{ height: '100%' }}
|
||||
value={text}
|
||||
language={extension}
|
||||
extensions={[EditorState.readOnly.of(true)]}
|
||||
/>
|
||||
) : (
|
||||
<Text>{text}</Text>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user