added linting

added linting
This commit is contained in:
2024-05-16 16:59:25 +07:00
parent d125687536
commit 5c4abf24bb
15 changed files with 1759 additions and 71 deletions

View File

@@ -1,9 +1,8 @@
"use client";
import { LocationContext } from "@/components/locationContenxt";
import { useContext, useEffect, useState } from "react";
import { LocationContext } from "@/components/locationContext";
import { useContext, useState } from "react";
import Grouping from "./Grouping";
import { unique } from "drizzle-orm/mysql-core";
type Props = {
allJobs: JobCategory[];
@@ -22,7 +21,7 @@ export default function GroupCreator({ allJobs }: Props) {
let locationContext = useContext(LocationContext);
let [usedJobs, setUsedJobs] = useState<number[]>([]);
let [groups, setGroup] = useState<Group[]>(
[...Array(4).keys()].map((i) => ({ id: i + 1, jobs: [] }))
[...Array(4).keys()].map((i) => ({ id: i + 1, jobs: [] })),
);
function useJob(id: number) {
setUsedJobs((u) => [...u, id]);
@@ -37,13 +36,11 @@ export default function GroupCreator({ allJobs }: Props) {
groups.map((g) => {
if (g.id != id) return g;
else return { id, jobs };
})
}),
);
}
useEffect(() => {
console.log(groups);
}, [groups]);
function submit() {} //TODO! submit group
if (
locationContext?.zone[0] == undefined ||
@@ -66,7 +63,9 @@ export default function GroupCreator({ allJobs }: Props) {
))}
<div className="flex justify-center">
<button className="bg-green-300 rounded-md p-2"></button>
<button className="rounded-md bg-green-300 p-2" onClick={submit}>
</button>
</div>
</div>
);