|
|
@@ -1,23 +1,41 @@
|
|
|
-import Message from "./Message";
|
|
|
import ListGroup from "./components/ListGroup";
|
|
|
-import { Fragment, useState } from "react";
|
|
|
-import { MouseEvent } from "react";
|
|
|
+import Alert from "./components/Alert";
|
|
|
+import { useState } from "react";
|
|
|
+import MyButt from "./components/MyButt";
|
|
|
+import Button from "@mui/material/Button";
|
|
|
|
|
|
// Following tutorial https://www.youtube.com/watch?v=SqcY0GlETPk
|
|
|
|
|
|
function App() {
|
|
|
const items = ["Dude", "Man", "Shit", "Is it working?"];
|
|
|
+ const [alertVisible, setAlertVisible] = useState(false);
|
|
|
|
|
|
const handleSelectItem = (item: string) => {
|
|
|
- console.debug("Yoman!");
|
|
|
+ console.debug(item);
|
|
|
+ };
|
|
|
+
|
|
|
+ const dismissError = () => {
|
|
|
+ setAlertVisible(false);
|
|
|
};
|
|
|
|
|
|
return (
|
|
|
<div>
|
|
|
+ {alertVisible && (
|
|
|
+ <Alert onClose={() => setAlertVisible(false)}>This is bad</Alert>
|
|
|
+ )}
|
|
|
+ <MyButt name="LöBöttån!" onClick={() => setAlertVisible(true)}>
|
|
|
+ Maan
|
|
|
+ </MyButt>
|
|
|
+ {<Button variant="contained">Hello World</Button>}
|
|
|
<ListGroup
|
|
|
items={items}
|
|
|
heading="Man shit list"
|
|
|
- onSelectedItem={handleSelectItem}
|
|
|
+ onSelectItem={handleSelectItem}
|
|
|
+ />
|
|
|
+ <ListGroup
|
|
|
+ items={["Hoho", "Hihi", "Thhihih"]}
|
|
|
+ heading="Skrat prat datt"
|
|
|
+ onSelectItem={handleSelectItem}
|
|
|
/>
|
|
|
</div>
|
|
|
);
|