add event title as a tooltip

feat/troubleshooter-v2
Sean Brydon 2023-10-26 13:02:12 +01:00
parent df9936858a
commit f11f587d1b
2 changed files with 26 additions and 18 deletions

View File

@ -1,6 +1,8 @@
import { cva } from "class-variance-authority";
import dayjs from "@calcom/dayjs";
import classNames from "@calcom/lib/classNames";
import { Tooltip } from "@calcom/ui";
import type { CalendarEvent } from "../../types/events";
@ -62,14 +64,18 @@ export function Event({
const Component = onEventClick ? "button" : "div";
return (
<Tooltip content={event.title}>
<Component
onClick={() => onEventClick?.(event)} // Note this is not the button event. It is the calendar event.
className={eventClasses({
className={classNames(
eventClasses({
status: options?.status,
disabled,
selected,
borderColor,
})}
}),
options?.className
)}
style={styles}>
<div className="w-full overflow-hidden overflow-ellipsis whitespace-nowrap text-left leading-4">
{event.title}
@ -80,5 +86,6 @@ export function Event({
</p>
)}
</Component>
</Tooltip>
);
}

View File

@ -10,5 +10,6 @@ export interface CalendarEvent {
status?: BookingStatus;
allDay?: boolean;
borderColor?: string;
className?: string;
};
}