"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.computeItemProps = computeItemProps;
const internalContentUtils_1 = require("../../content/_internal/internalContentUtils");
const utils_1 = require("../../discussions/utils");
/**
 * Base property mapping for item backed entity types
 * @param item IItem
 * @param entity IHubItemEntity
 * @returns
 */
function computeItemProps(item, entity) {
    // Handle Dates
    entity.createdDate = new Date(item.created);
    entity.createdDateSource = "item.created";
    entity.updatedDate = new Date(item.modified);
    entity.updatedDateSource = "item.modified";
    // TODO: thumbnail url?
    // location
    entity.location = entity.location || (0, internalContentUtils_1.deriveLocationFromItem)(item);
    // isDiscussable
    entity.isDiscussable = (0, utils_1.isDiscussable)(item);
    // return updated (mutated) entity
    return entity;
}
//# sourceMappingURL=computeItemProps.js.map