diff options
Diffstat (limited to 'web/src/pages/echo.js')
-rw-r--r-- | web/src/pages/echo.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/web/src/pages/echo.js b/web/src/pages/echo.js new file mode 100644 index 0000000..6ba7e67 --- /dev/null +++ b/web/src/pages/echo.js @@ -0,0 +1,22 @@ +import React from "react"; +import { useLoaderData, useParams } from "react-router"; +import Message from "../components/message"; + +const Echo = () => { + const {echo, messages} = useLoaderData(); + const params = useParams(); + if (!echo) { + return (<article aria-busy="true">Загрузка списка сообщений</article>) + } + return ( + <> + <h1>{echo.name}</h1> + <p>Сообщений: {echo.count}</p> + {messages.map((message) => ( + <Message key={message.id} message={message} /> + ))} + </> + ); +}; + +export default Echo; |