import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
// (C) 2007-2026 GoodData Corporation
import { FormattedDate, FormattedMessage, FormattedTime, defineMessage } from "react-intl";
/**
 * @internal
 */
export function InsightListItemDate({ config }) {
    const relativeDate = config.isToday
        ? defineMessage({ id: "gs.date.today" }).id
        : defineMessage({ id: "gs.date.yesterday" }).id;
    if (config.isToday || config.isYesterday) {
        return (_jsxs("span", { children: [
                _jsx(FormattedMessage, { id: relativeDate }),
                "\u00A0",
                _jsx(FormattedMessage, { id: "gs.date.at" }),
                "\u00A0",
                _jsx(FormattedTime, { value: config.date, format: "hhmm" })
            ] }));
    }
    else if (config.isCurrentYear) {
        return _jsx(FormattedDate, { value: config.date, format: "shortWithoutYear" });
    }
    return _jsx(FormattedDate, { value: config.date, format: "shortWithYear" });
}
