mirror of
https://github.com/supabase/supabase.git
synced 2026-07-04 10:35:03 +08:00
22 lines
411 B
JavaScript
22 lines
411 B
JavaScript
import { useEffect, useRef } from 'react'
|
|
|
|
export default function TextLog({ log }) {
|
|
const textLog = useRef(null)
|
|
|
|
useEffect(() => {
|
|
textLog.current.scrollTop = textLog.current.scrollHeight
|
|
}, [log])
|
|
|
|
return (
|
|
<>
|
|
<textarea ref={textLog} readOnly value={log} />
|
|
<style jsx>{`
|
|
textarea {
|
|
width: 100%;
|
|
height: 7rem;
|
|
}
|
|
`}</style>
|
|
</>
|
|
)
|
|
}
|