diff --git a/frontend/src/components/ConsultantRow.tsx b/frontend/src/components/ConsultantRow.tsx index 58143851..468230cc 100644 --- a/frontend/src/components/ConsultantRow.tsx +++ b/frontend/src/components/ConsultantRow.tsx @@ -1,5 +1,5 @@ "use client"; -import { BookingType, Consultant } from "@/types"; +import { BookingType, Consultant, DetailedBooking } from "@/types"; import { ReactElement, useState } from "react"; import { AlertTriangle, @@ -12,17 +12,14 @@ import { } from "react-feather"; import InfoPill from "./InfoPill"; -interface ConsultantListElementProps { - consultant: Consultant; -} - export default function ConsultantRows({ consultant, }: { consultant: Consultant; }) { const [isListElementVisible, setIsListElementVisible] = useState(false); - const [isButtonHovered, setIsButtonHovered] = useState(false); + const [isRowHovered, setIsRowHovered] = useState(false); + const [hoveredRowWeek, setHoveredRowWeek] = useState(-1); function toggleListElementVisibility() { setIsListElementVisible(!isListElementVisible); @@ -32,14 +29,14 @@ export default function ConsultantRows({ <> setIsButtonHovered(true)} - onMouseLeave={() => setIsButtonHovered(false)} + onMouseEnter={() => setIsRowHovered(true)} + onMouseLeave={() => setIsRowHovered(false)} > (
0 ? `bg-black text-white` : b.bookingModel.totalSellableTime > 0 ? `bg-semantic_4_l1` : `bg-primary_l5` }`} + onMouseEnter={() => setHoveredRowWeek(b.weekNumber)} + onMouseLeave={() => setHoveredRowWeek(-1)} > +
+ d.hours + .filter((h) => h.week % 100 == b.weekNumber) + .reduce((sum, h) => sum + h.hours, 0), + ) + .reduce((a, b) => a + b, 0) == 0) && + "hidden" + }`} + > +
+ {consultant.detailedBooking.map((db, index) => ( + <> + {db.hours.find((hour) => hour.week % 100 == b.weekNumber) + ?.hours != 0 && ( +
+ db.hours.find( + (hour) => hour.week % 100 == b.weekNumber, + )?.hours != 0, + ).length - + 1 && "border-b pb-2 border-hover_background" + }`} + > +
+
+ {getIconByBookingType(db.bookingDetails.type)} +
+

+ {db.bookingDetails.name} +

+
+

+ { + db.hours.find( + (hour) => hour.week % 100 == b.weekNumber, + )?.hours + } +

+
+ )} + + ))} +
+
+
{b.bookingModel.totalOffered > 0 && ( )}
-

- +

@@ -208,13 +264,13 @@ function getColorByStaffingType(type: BookingType): string { function getIconByBookingType(type: BookingType): ReactElement { switch (type) { case BookingType.Offer: - return ; + return ; case BookingType.Booking: - return ; + return ; case BookingType.Vacation: - return ; + return ; case BookingType.PlannedAbsence: - return ; + return ; default: return <>; } diff --git a/frontend/src/components/InfoPillDescriptions.tsx b/frontend/src/components/InfoPillDescriptions.tsx index dfb3e0b6..783fb399 100644 --- a/frontend/src/components/InfoPillDescriptions.tsx +++ b/frontend/src/components/InfoPillDescriptions.tsx @@ -1,9 +1,22 @@ import InfoPill from "@/components/InfoPill"; -import { AlertTriangle, Calendar, Coffee, FileText, Sun } from "react-feather"; +import { + AlertTriangle, + Briefcase, + Calendar, + Coffee, + FileText, + Moon, + Sun, +} from "react-feather"; export default function InfoPillDescriptions() { return (
+ } + /> } /> + } + />
); } diff --git a/frontend/tailwind.config.ts b/frontend/tailwind.config.ts index eb2039ca..b34a2dbb 100644 --- a/frontend/tailwind.config.ts +++ b/frontend/tailwind.config.ts @@ -28,12 +28,14 @@ export default { overbooking_dark: "#B91456", absence_light: "#9FDFD9", absence_dark: "#004C46", + hover_background: "#F0EFEF", transparent: "transparent", }, extend: {}, screens, boxShadow: { md: "0 4px 4px 0 rgba(66, 61, 137, 0.10)", + xl: "0px 4px 20px 0px rgba(0, 0, 0, 0.30)", }, }, plugins: [],