From d261b10e2d3223fe019fc5e104286c43396f40a3 Mon Sep 17 00:00:00 2001 From: Dilson's Pickles Date: Wed, 23 Aug 2023 14:33:40 +1000 Subject: [PATCH] Componentise OS card --- src/components/card/OperatingSystemCard.jsx | 68 +++++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 src/components/card/OperatingSystemCard.jsx diff --git a/src/components/card/OperatingSystemCard.jsx b/src/components/card/OperatingSystemCard.jsx new file mode 100644 index 0000000..be8206b --- /dev/null +++ b/src/components/card/OperatingSystemCard.jsx @@ -0,0 +1,68 @@ +import React from "react"; + +function OperatingSystemCard(props) { + const { title, description } = props; + + function renderOSIcon(title) { + switch (title) { + case "Windows": + return ( + + + + ); + + case "Mac OS": + return ( + + {/* */} + + + ); + + case "Linux": + return ( + + {/* */} + + + ); + + default: + return ( + + {/* */} + + + ); + } + } + + return ( + +
+ {renderOSIcon(title)} +

{title}

+

{description}

+
+
+ ); +} + +export default OperatingSystemCard; \ No newline at end of file