2024-08-19 03:51:17 -04:00
|
|
|
import React from 'react';
|
2024-08-13 03:04:27 -04:00
|
|
|
import MessageBlock from './MessageBlock';
|
|
|
|
|
|
|
|
|
|
interface AnnouncerProps {
|
|
|
|
|
politeMessage: string;
|
|
|
|
|
politeMessageId: string;
|
|
|
|
|
assertiveMessage: string;
|
|
|
|
|
assertiveMessageId: string;
|
|
|
|
|
}
|
|
|
|
|
|
2024-08-19 03:51:17 -04:00
|
|
|
const Announcer: React.FC<AnnouncerProps> = ({ politeMessage, assertiveMessage }) => {
|
2024-08-13 03:04:27 -04:00
|
|
|
return (
|
|
|
|
|
<div>
|
2024-08-19 03:51:17 -04:00
|
|
|
<MessageBlock aria-live="assertive" aria-atomic="true" message={assertiveMessage} />
|
|
|
|
|
<MessageBlock aria-live="polite" aria-atomic="false" message={politeMessage} />
|
2024-08-13 03:04:27 -04:00
|
|
|
</div>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default Announcer;
|