diff --git a/src/App.jsx b/src/App.jsx index c902699..8e54f50 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -3,6 +3,7 @@ import { useState } from 'react' import initialEmails from './data/emails' import './styles/App.css' +import Emails from './components/Emails' const getReadEmails = emails => emails.filter(email => !email.read) @@ -87,35 +88,7 @@ function App() { -
- -
+ ) } diff --git a/src/components/Email.jsx b/src/components/Email.jsx new file mode 100644 index 0000000..e8c5ea0 --- /dev/null +++ b/src/components/Email.jsx @@ -0,0 +1,28 @@ + +const Email = ({email, toggleRead, toggleStar}) => { + + return ( + <> +
+ toggleRead(email)} + /> +
+
+ toggleStar(email)} + /> +
+
{email.sender}
+
{email.title}
+ + ) +} + +export default Email; \ No newline at end of file diff --git a/src/components/Emails.jsx b/src/components/Emails.jsx new file mode 100644 index 0000000..e5490ac --- /dev/null +++ b/src/components/Emails.jsx @@ -0,0 +1,23 @@ +import Email from "./Email"; + +const Emails = ({emails, toggleRead, toggleStar}) => { + + return ( + <> +
+ +
+ + ) +} + +export default Emails; \ No newline at end of file