@progress/sitefinity-nextjs-sdk
Version:
Provides OOB widgets developed using the Next.js framework, which includes an abstraction layer for Sitefinity communication. Additionally, it offers an expanded API, typings, and tools for further development and integration.
25 lines (24 loc) • 2.41 kB
JavaScript
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
import { SanitizerService } from '../../../services/sanitizer-service';
export function EventDetailView(props) {
const city = props.detailItem?.City;
const country = props.detailItem?.Country;
const street = props.detailItem?.Street;
const contactName = props.detailItem?.ContactName;
const contactPhone = props.detailItem?.ContactPhone;
const contactCell = props.detailItem?.ContactCell;
const contactEmail = props.detailItem?.ContactEmail;
const contactWeb = props.detailItem?.ContactWeb;
const location = props.detailItem?.Location;
const description = props.detailItem?.Description;
const summary = props.detailItem?.Summary;
const content = props.detailItem?.Content;
return (_jsxs("div", { ...props.attributes, children: [_jsx("h3", { className: "sf-event-title", children: _jsx("span", { children: props.detailItem?.Title }) }), _jsx("span", { className: "sf-event-type", style: { background: props.detailItem?.Parent?.Color, display: 'inline-block', height: '20px', width: '20px' } }), (city || country) && (_jsxs("address", { children: [(() => {
if (city && !country) {
return (_jsxs(_Fragment, { children: [city, " ", _jsx("span", { children: "," }), " ", country, _jsx("br", {})] }));
}
else {
return (_jsxs(_Fragment, { children: [!city ? country : city, _jsx("br", {})] }));
}
})(), street && street] })), _jsxs("div", { children: [contactName && (_jsxs(_Fragment, { children: [contactName, _jsx("br", {})] })), contactPhone && (_jsxs(_Fragment, { children: [contactPhone, _jsx("br", {})] })), contactCell && (_jsxs(_Fragment, { children: [contactCell, _jsx("br", {})] })), contactEmail && (_jsx("address", { children: _jsx("a", { href: `mailto:${contactEmail}`, target: "_blank", children: contactEmail }) })), contactWeb && (_jsx("a", { href: contactWeb, target: "_blank", children: contactWeb }))] }), location && (_jsx("p", { children: location })), description && (_jsx("p", { children: description })), summary && (_jsx("p", { children: summary })), content && (_jsx("p", { dangerouslySetInnerHTML: { __html: SanitizerService.getInstance().sanitizeHtml(content) } }))] }));
}