refactor: repo (#1070)

This commit is contained in:
Mo
2022-06-07 07:18:41 -05:00
committed by GitHub
parent 4c65784421
commit f4ef63693c
1102 changed files with 5786 additions and 3366 deletions

View File

@@ -0,0 +1,26 @@
import { ElementIds } from '@/Constants/ElementIDs'
import { useMemo } from 'react'
type Props = {
bytes: Uint8Array
}
const TextPreview = ({ bytes }: Props) => {
const text = useMemo(() => {
const textDecoder = new TextDecoder()
return textDecoder.decode(bytes)
}, [bytes])
return (
<textarea
autoComplete="off"
className="w-full h-full flex-grow font-editor focus:shadow-none focus:outline-none"
dir="auto"
id={ElementIds.FileTextPreview}
defaultValue={text}
readOnly={true}
></textarea>
)
}
export default TextPreview