Skip to content
Snippets Groups Projects
Commit 2454c137 authored by Kevin Portable's avatar Kevin Portable
Browse files

Synchronisation des tâches existantes et du module de statistique en pourcentages

parent f1b6f000
No related branches found
No related tags found
No related merge requests found
import React from 'react';
import React, { useContext } from "react";
import { TasksContext } from "@services/Context";
const TasksStatPercent = () => {
const { tasks } = useContext(TasksContext);
const totalTasks = tasks.length;
const completedTasks = tasks.filter(task => task.isCompleted).length;
const TasksStatPercent = ({ totalTasks, completedTasks }) => {
const radius = 50;
const circumference = 2 * Math.PI * radius;
const completedPercentage = totalTasks === 0 ? 0 : Math.round((completedTasks / totalTasks) * 100);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment