Files
pedwfrontend/components/search/liveLink.js
T
Robert Bond b6bd543527 Merged PR 2329: welsh link for events
welsh link for events

Related work items: #23054
2026-05-18 08:50:58 +00:00

34 lines
919 B
JavaScript

import useTranslation from "next-translate/useTranslation";
import { getLivePublishedEvent } from "../case/summary/utils/liveEvent";
const LiveLink = ({ detailsObj, locale }) => {
let { t } = useTranslation();
const eventsObj = {
value: detailsObj?.pinswg_sips_pinswg_sipsevent || []
};
const liveEvent = getLivePublishedEvent(eventsObj);
if (!liveEvent) return null;
return (
<div className="govuk-!-margin-top-3">
<a
href={
locale === "en"
? liveEvent.pinswg_linktotheevent
: liveEvent.pinswg_linktotheeventstreamwelsh
}
className="govuk-link"
target="_blank"
rel="noopener noreferrer"
>
{t("case:live-event-link")}
</a>
</div>
);
};
export default LiveLink;