diff --git a/web/src/components/ReleaseTabs.tsx b/web/src/components/ReleaseTabs.tsx
index 32e7968..eb3ab6b 100644
--- a/web/src/components/ReleaseTabs.tsx
+++ b/web/src/components/ReleaseTabs.tsx
@@ -6,14 +6,14 @@ import { statusLabel } from '@/lib/filterOpportunities';
import { formatDate, formatDateTime, formatValue } from '@/lib/format';
import type { ReleaseValue } from '@/lib/ocdsRelease';
import { parseReleaseData, summariseRelease } from '@/lib/ocdsRelease';
-import { findATenderNoticeUrl } from '@/lib/opportunities';
+import type { NoticeSite } from '@/lib/opportunities';
import type { OpportunityRelease } from '@/types/Opportunities';
import { JsonView } from './JsonView';
interface Props {
releases: OpportunityRelease[];
- /** Whether the releases are Find a Tender notices, so each can link to its notice. */
- isFromFindATender: boolean;
+ /** The site the releases are notices on, so each can link to its notice; undefined if none. */
+ site: NoticeSite | undefined;
}
const tabClass =
@@ -44,7 +44,7 @@ function Field(props: FieldProps): JSX.Element {
interface ReleasePanelProps {
release: OpportunityRelease;
- isFromFindATender: boolean;
+ site: NoticeSite | undefined;
}
/** One release: its notice, a summary of its tender, awards and contracts, and its JSON. */
@@ -53,6 +53,11 @@ function ReleasePanel(props: ReleasePanelProps): JSX.Element {
const summary = createMemo(() => summariseRelease(parsed()));
// The JSON is only laid out once it's opened: a release can be 100KB or more.
const [isJsonOpen, setIsJsonOpen] = createSignal(false);
+ const notice = () => {
+ const site = props.site;
+ const url = site?.urlFor(props.release);
+ return site && url ? { name: site.name, url } : undefined;
+ };
const json = () => {
const data = parsed();
return data === undefined ? props.release.data : JSON.stringify(data, null, 2);
@@ -66,16 +71,18 @@ function ReleasePanel(props: ReleasePanelProps): JSX.Element {
{formatDateTime(props.release.release_date)}
{tagsOf(props.release) || '—'}
-
-
- Open notice on Find a Tender
-
-
+
+ {(notice) => (
+
+ Open notice on {notice().name}
+
+
+ )}
@@ -220,9 +227,7 @@ export function ReleaseTabs(props: Props): JSX.Element {