import clsx from "clsx" import moment from "moment" import React, { ReactNode, useState } from "react" import Tooltip from "../../atoms/tooltip" import BellOffIcon from "../../fundamentals/icons/bell-off-icon" import ChevronDownIcon from "../../fundamentals/icons/chevron-down" import ChevronUpIcon from "../../fundamentals/icons/chevron-up" export enum EventIconColor { GREEN = "text-emerald-40", RED = "text-rose-50", ORANGE = "text-orange-40", VIOLET = "text-violet-60", DEFAULT = "text-grey-50", } export type EventContainerProps = { icon: React.ReactNode iconColor?: EventIconColor title: string time: Date noNotification?: boolean topNode?: React.ReactNode midNode?: React.ReactNode isFirst?: boolean expandable?: boolean children: ReactNode detail?: string | React.ReactNode } const EventContainer: React.FC = ({ icon, iconColor = EventIconColor.DEFAULT, title, topNode, midNode, time, noNotification = false, isFirst = false, expandable = false, children, detail, }) => { const [isExpanded, setIsExpanded] = useState(!expandable) const toggleExpand = () => { setIsExpanded((prev) => !prev) } return (
{icon}
{title}
{noNotification && ( )} {topNode} {expandable && ( )}
{!isFirst &&
}
{moment(time).fromNow()}
{midNode && ( )} {midNode}
{children && isExpanded && (
{children}
)}
{detail}
) } const Dot = ({ size = "2px", bg = "bg-grey-50" }) => { return
} export default EventContainer