diff --git a/app/page.tsx b/app/page.tsx
index 24afb48..99e9c00 100644
--- a/app/page.tsx
+++ b/app/page.tsx
@@ -2,8 +2,6 @@
import { useState } from 'react';
import { useRouter } from 'next/navigation';
-import { Button } from "@components/ui/button";
-import { Input } from "@/components/ui/input"
export default function Home() {
const [password, setPassword] = useState('');
@@ -17,15 +15,13 @@ export default function Home() {
}
return (
-
-
Calendrier-avent
+
+
Calendrier-avent
Please enter the password :
-
-
);
}
diff --git a/app/results/page.tsx b/app/results/page.tsx
index d03a1de..e278635 100644
--- a/app/results/page.tsx
+++ b/app/results/page.tsx
@@ -1,89 +1,11 @@
"use client";
-import {Bar} from "react-chartjs-2";
-import prisma from "@lib/prisma";
-
-import Head from 'next/head'
-
-import {
- Chart as ChartJS,
- CategoryScale,
- LinearScale,
- PointElement,
- LineElement,
- Title,
- Tooltip,
- Legend,
- Filler,
-} from "chart.js";
-
-ChartJS.register (
- CategoryScale,
- LinearScale,
- PointElement,
- LineElement,
- Filler,
- Title,
- Tooltip,
- Legend
-);
-
-interface IPower {
- date: string,
- value: number
-}
-
-interface IChart {
- labels : string[],
- datasets: [
- {
- label: string,
- data: number[],
- fill: true,
- backgroundColor: string,
- borderColor: string,
- },
- ],
-}
-
-export default async function Results() {
- const grades = await prisma.grade.findMany()
- const gradesArray = grades.map(grade => grade.grade.toString())
- const allGrades = ["1", "1,5", "2", "2,5", "3", "3,5", "4", "4,5", "5", "5,5", "6"]
- const gradesCount = allGrades.map(grade => gradesArray.filter(g => g === grade).length)
- console.log(allGrades)
- console.log(gradesCount)
-
- const options = {
- responsive: true,
- plugins: {
- legend: {
- position: 'top' as const,
- },
- title: {
- display: true,
- text: 'Energy Production/Consumption',
- },
- },
- };
+import {DayCard} from "@components/custom/dayCard";
+export default function Results() {
return (
- <>
-
-
Solar
-
-
-
-
-
- { gradesCount ?
- <>
- {console.log("datas", gradesArray)}
-
- >
- : null
- }
-
- >
+
+
+
)
}
diff --git a/components/custom/dayCard.tsx b/components/custom/dayCard.tsx
new file mode 100644
index 0000000..47b0d92
--- /dev/null
+++ b/components/custom/dayCard.tsx
@@ -0,0 +1,48 @@
+"use client";
+
+import { BellRing, Check } from "lucide-react"
+
+import { cn } from "@/lib/utils"
+import { Button } from "@/components/ui/button"
+import {
+ Card,
+ CardContent,
+ CardDescription,
+ CardFooter,
+ CardHeader,
+ CardTitle,
+} from "@/components/ui/card"
+
+type CardProps = React.ComponentProps
+
+interface DayCardProps extends CardProps {
+ day: number,
+ name: string,
+ enabled: boolean
+}
+
+export function DayCard({ className, ...props }: DayCardProps) {
+ return (
+
+
+ {props.enabled ?
+
+
1
+
+
Michal Polka
+
Description
+
+
+ :
+
+
1
+
+
Michal Polka
+
Description
+
+
+ }
+
+
+ )
+}
diff --git a/tsconfig.json b/tsconfig.json
index 8f2577e..fbc8f6b 100644
--- a/tsconfig.json
+++ b/tsconfig.json
@@ -21,8 +21,8 @@
"paths": {
"@/*": ["./*"],
"@components/*": ["./components/*"],
- "@lib/*": ["./lib/*"],
- "@styles/*": ["./styles/*"],
+ "@lib/*": ["/lib/*"],
+ "@styles/*": ["/styles/*"],
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],