The App.js file For A Sacred Scriptures App

import { useState } from 'react';
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom';
import Bible from './Bible';
import Quran from './Quran';
import Bhagavadgita from './Bhagavadgita';
import Dhammapada from './Dhammapada';
import Contemplations from './Contemplations';

function App() {
const [selectedComponents, setSelectedComponents] = useState({
bible: false,
quran: false,
bhagavadgita: false,
dhammapada: false,
contemplations: false,
});

const handleItemClick = (component) => {
setSelectedComponents({
...selectedComponents,
[component]: !selectedComponents[component],
});
};

const handleAllClick = () => {
const allSelected = Object.values(selectedComponents).every((value) => value);
const updatedComponents = {};

for (const key in selectedComponents) {
updatedComponents[key] = !allSelected;
}

setSelectedComponents(updatedComponents);
};

return (



{selectedComponents.bible && }
{selectedComponents.quran && }
{selectedComponents.bhagavadgita && }
{selectedComponents.dhammapada && }
{selectedComponents.contemplations && }

} />


);
}

export default App;

Related Articles

ChatGPT-generated coding lesson (001): Embarking on the Exciting Journey of Computer Programming

Title: Embarking on the Exciting Journey of Computer Programming Introduction: Welcome, budding programmers, to the enchanting world of computer programming! As you embark on this thrilling journey, imagine yourself as the maestro orchestrating the symphony of code, bringing life to digital realms. Today, let’s unravel three fundamental concepts that will be your companions on this…

Responses

dainis w michel