import React from "react"; import clsx from "clsx"; import { useTranslation } from "react-i18next"; import { Dropdown, Button } from "react-bootstrap"; import { timelineVisibilityTooltipTranslationMap } from "@/services/timeline"; import { TimelineCardComponentProps } from "../timeline-common/TimelinePageTemplateUI"; import SyncStatusBadge from "../timeline-common/SyncStatusBadge"; import CollapseButton from "../timeline-common/CollapseButton"; export interface TimelineCardTemplateProps extends Omit, "operations"> { operations: Pick< TimelineCardComponentProps<"">["operations"], "onHighlight" | "onBookmark" >; infoArea: React.ReactElement; manageArea: | { type: "member"; onMember: () => void } | { type: "manage"; items: ( | { type: "button"; text: string; color?: string; onClick: () => void; } | { type: "divider" } )[]; }; } function TimelineCardTemplate({ timeline, collapse, infoArea, manageArea, operations, toggleCollapse, syncStatus, className, }: TimelineCardTemplateProps): React.ReactElement | null { const { t } = useTranslation(); const { onBookmark, onHighlight } = operations; return (
{infoArea}

{timeline.description}

{t(timelineVisibilityTooltipTranslationMap[timeline.visibility])}
{onHighlight != null ? ( ) : null} {onBookmark != null ? ( ) : null} {manageArea.type === "manage" ? ( {t("timeline.manage")} {manageArea.items.map((item, index) => { if (item.type === "divider") { return ; } else { return ( {t(item.text)} ); } })} ) : ( )}
); } export default TimelineCardTemplate;