import { html } from "lit-html"; import { __ } from '@converse/headless/i18n'; const i18n_desc_rooms = __('Click to toggle the list of open groupchats'); const i18n_add_bookmark = __('Bookmark this groupchat'); const i18n_leave_room = __('Leave this groupchat'); const i18n_remove_bookmark = __('Unbookmark this groupchat'); const i18n_title = __('Show more information on this groupchat'); const i18n_open = __('Click to open this groupchat'); // Note to translators, "Open Groupchats" refers to groupchats that are open, NOT a command. const i18n_rooms = __('Open Groupchats'); const unread_indicator = (o) => html`${ o.room.get('num_unread') }`; const bookmark = (o) => { if (o.bookmarked) { return html` `; } else { return html` `; } } const room_item = (o) => html`
${ o.room.get('num_unread') ? unread_indicator(o) : '' } ${o.room.getDisplayName()} ${ o.allow_bookmarks ? bookmark(o) : '' }
`; export default (o) => html`
${i18n_rooms}
${ o.rooms.map(room => room_item(Object.assign({room}, o))) }
`;