mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-30 15:18:50 +01:00
* WIP: first pass, hooks * wip: isStream arg * feat: first pass, dynamic content updates, screen reader announcements * chore: unrelated, styling redundancy
26 lines
553 B
TypeScript
26 lines
553 B
TypeScript
import React from 'react';
|
|
|
|
const offScreenStyle: React.CSSProperties = {
|
|
border: 0,
|
|
clip: 'rect(0 0 0 0)',
|
|
height: '1px',
|
|
margin: '-1px',
|
|
overflow: 'hidden',
|
|
whiteSpace: 'nowrap',
|
|
padding: 0,
|
|
width: '1px',
|
|
position: 'absolute',
|
|
};
|
|
|
|
interface MessageBlockProps {
|
|
message: string;
|
|
'aria-live': 'polite' | 'assertive';
|
|
}
|
|
|
|
const MessageBlock: React.FC<MessageBlockProps> = ({ message, 'aria-live': ariaLive }) => (
|
|
<div style={offScreenStyle} role="log" aria-live={ariaLive}>
|
|
{message}
|
|
</div>
|
|
);
|
|
|
|
export default MessageBlock;
|