import React from "react";
import { Flex, Icon, Text, TextSmall } from "@netdata/netdata-ui";
import Image from "./image";
import Anchor from "./anchor";
const Item = ({ item }) => {
    const { last_publication_date: publishedAt, data } = item;
    const { title, description, url, image, label } = data;
    const imageSrc = image && image.url;
    const dateFormated = new Date(publishedAt);
    return (React.createElement(Flex, { column: true, gap: 2 },
        React.createElement(Flex, { gap: 4 },
            imageSrc && React.createElement(Image, { src: imageSrc, width: "160px" }),
            React.createElement(Flex, { column: true, gap: 2 },
                React.createElement(Text, { strong: true }, title),
                React.createElement(Text, null, description))),
        React.createElement(Flex, { justifyContent: "between", alignItems: "center" },
            React.createElement(TextSmall, null, dateFormated.toLocaleDateString()),
            React.createElement(Anchor, { href: url, target: "_blank", rel: "noopener noreferrer", gap: 1, alignItems: "center" },
                React.createElement(Text, { color: "success", strong: true }, label),
                React.createElement(Icon, { color: "success", rotate: 2, name: "arrow_left" })))));
};
export default Item;
//# sourceMappingURL=index.js.map