2019-09-12 01:34:11 +02:00
|
|
|
import html from 'choo/html';
|
|
|
|
|
|
|
|
import { modal } from '../partials/modal';
|
|
|
|
|
2019-09-12 05:51:59 +02:00
|
|
|
export const resultDetails = (searchController, result, buttonHTML) => {
|
|
|
|
const { i18n } = searchController;
|
2019-09-12 01:34:11 +02:00
|
|
|
const modalId = `result_${result.uri}}`;
|
|
|
|
const modalContent = html`<article>
|
|
|
|
<span class="tooltip-left" data-tooltip=${i18n.__('search.see_details_tooltip')}>
|
|
|
|
<a class="small pseudo button" href=${result.link} target="_blank">
|
|
|
|
${i18n.__('search.see_details')}
|
|
|
|
</a>
|
|
|
|
</span>
|
|
|
|
</article>`;
|
|
|
|
|
|
|
|
return modal(modalId, searchController, modalContent, {
|
|
|
|
buttonText: i18n.__('search.see_details'), // This should be replaced with buttonHTML containing the ratings and number of reviews etc.
|
|
|
|
headerText: result.name,
|
|
|
|
});
|
|
|
|
}
|