diff --git a/src/index.js b/src/index.js index df2bcca..c6b1567 100644 --- a/src/index.js +++ b/src/index.js @@ -1,3 +1,4 @@ +import IconButton from "@mui/material/IconButton"; import DeleteIcon from "@mui/icons-material/Delete"; import "./App.css"; import React from "react"; @@ -14,6 +15,8 @@ import Checkbox from "@mui/material/Checkbox"; import { Proiezione } from "./Proiezione"; import { MyForm } from "./MyForm"; import { Admin } from "./Admin"; +import { Button } from "@mui/material"; +import { Stack } from "@mui/system"; const firebaseConfig = { apiKey: "AIzaSyBWE1l8WV_7eyKT-PMu0Kq2w_WiV0SUhJw", @@ -30,43 +33,45 @@ firebase.initializeApp(firebaseConfig); export function CheckboxListSecondary({ messaggi, onChecked }) { return ( - + {messaggi.map((m) => { const labelId = `checkbox-list-secondary-label-${m.timestamp}`; return ( - }> - Delete - - } - secondaryAction={ - onChecked(m)} - checked={m.approvato} - inputProps={{ "aria-labelledby": labelId }} - /> - } - disablePadding - > - - {m.immagineURL && ( - - )} - - - + + onChecked(m)} + checked={m.approvato} + inputProps={{ "aria-labelledby": labelId }} + /> + +
+ +

{`"${m.testo}" da ${m.autore}`}

+ { + firebase + .database() + .ref("messaggi/" + m.id) + .remove(); + }} + > + + + ); })} - + ); }