30 lines
762 B
JavaScript
30 lines
762 B
JavaScript
import useTranslation from "next-translate/useTranslation";
|
|
import { getLivePublishedEvent } from "../case/summary/utils/liveEvent";
|
|
|
|
const LiveLink = ({ detailsObj }) => {
|
|
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={liveEvent.pinswg_linktotheevent}
|
|
className="govuk-link"
|
|
target="_blank"
|
|
rel="noopener noreferrer"
|
|
>
|
|
{t("case:live-event-link")}
|
|
</a>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default LiveLink;
|