11import React , { FC , memo } from "react" ;
2+ import { Priorities } from "@core/constants/core.constants" ;
23import { DAY_COMPACT , DAY_HOUR_MIN_M } from "@core/constants/date.constants" ;
3- import { Schema_GridEvent } from "@web/common/ types/web. event.types" ;
4+ import { Schema_Event } from "@core/ types/event.types" ;
45import { getWidthBuffer } from "@web/common/utils/grid.util" ;
56import { Flex } from "@web/components/Flex" ;
67import { AlignItems , FlexWrap } from "@web/components/Flex/styled" ;
@@ -15,23 +16,22 @@ import { WeekProps } from "@web/views/Calendar/hooks/useWeek";
1516import { DateCalcs } from "@web/views/Calendar/hooks/grid/useDateCalcs" ;
1617import { SpaceCharacter } from "@web/components/SpaceCharacter" ;
1718import { snapToGrid } from "@web/views/Calendar/components/Event/Grid/GridEventPreview/snap.grid" ;
18- import { MouseCoords } from "@web/views/Calendar/hooks/draft/sidebar/useMousePosition" ;
1919
2020import { getItemStyles , layerStyles , StyledGridEventPreview } from "./styled" ;
2121
22- export interface Props {
22+ interface Props {
2323 dateCalcs : DateCalcs ;
2424 dayIndex : number ;
25- event : Schema_GridEvent ;
25+ event : Schema_Event ;
2626 isOverAllDayRow : boolean ;
2727 isOverMainGrid : boolean ;
2828 measurements : Measurements_Grid ;
29- mouseCoords : MouseCoords ;
29+ mouseCoords : { x : number ; y : number } ;
3030 startOfView : WeekProps [ "component" ] [ "startOfView" ] ;
3131 gridScrollRef : Refs_Grid [ "gridScrollRef" ] ;
3232}
3333
34- export const GridEventPreview : FC < Props > = memo ( function GridEventPreview ( {
34+ const _GridEventPreview : FC < Props > = ( {
3535 dateCalcs,
3636 dayIndex,
3737 event,
@@ -41,7 +41,7 @@ export const GridEventPreview: FC<Props> = memo(function GridEventPreview({
4141 mouseCoords,
4242 startOfView,
4343 gridScrollRef,
44- } ) {
44+ } ) => {
4545 const { colWidths } = measurements ;
4646 const { x, y } = mouseCoords ;
4747
@@ -93,7 +93,7 @@ export const GridEventPreview: FC<Props> = memo(function GridEventPreview({
9393 className = { "active" }
9494 duration = { 1 }
9595 height = { height }
96- priority = { event . priority }
96+ priority = { event . priority || Priorities . UNASSIGNED }
9797 role = "button"
9898 tabIndex = { 0 }
9999 width = { width }
@@ -114,4 +114,6 @@ export const GridEventPreview: FC<Props> = memo(function GridEventPreview({
114114 </ div >
115115 </ div >
116116 ) ;
117- } ) ;
117+ } ;
118+
119+ export const GridEventPreview = memo ( _GridEventPreview ) ;
0 commit comments