import * as React from "react"; import { useState } from "react"; import styles from "../../styles"; import { Switch } from "@mui/material"; import Notes from "../Notes/Notes"; import PublicNotes from "../PublicNotes/Notes"; export default function ViewToggle() { const [switchLabel, setLabel] = useState("Viewing public notes"); const [togglePublic, setToggled] = useState(true); if (togglePublic) { return (
{ setToggled(!togglePublic); if (togglePublic) { setLabel("Viewing own notes"); } else { setLabel("Viewing public notes"); } }} />

{switchLabel}

); } return (
{ setToggled(!togglePublic); if (togglePublic) { setLabel("Viewing own notes"); } else { setLabel("Viewing public notes"); } }} />

{switchLabel}

); }