Skip to content

Commit 192a9a7

Browse files
committed
fix: resolve TS build error in jobs/[id]/page.tsx
Extract githubIssueUrl via typed helper function to avoid 'unknown is not assignable to ReactNode' error from job.metadata?.githubIssueUrl expression in JSX. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 5363e33 commit 192a9a7

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

‎app/src/app/jobs/[id]/page.tsx‎

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,13 @@ function getJobDeadline(job: JobDetail): string | null {
103103
return trimmed || null;
104104
}
105105

106+
function getJobGithubIssueUrl(job: JobDetail): string | null {
107+
const raw =
108+
job.metadata && typeof job.metadata.githubIssueUrl === 'string' ? job.metadata.githubIssueUrl : '';
109+
const trimmed = raw.trim();
110+
return trimmed || null;
111+
}
112+
106113
function getJobMinAcceptedBidLamports(job: JobDetail): bigint {
107114
const raw =
108115
job.metadata && typeof (job.metadata as any).minAcceptedBidLamports !== 'undefined'
@@ -277,6 +284,7 @@ export default function JobDetailPage() {
277284
const statusColor = STATUS_COLORS[job.status] || 'var(--text-secondary)';
278285
const category = getJobCategory(job);
279286
const deadline = getJobDeadline(job);
287+
const githubIssueUrl = getJobGithubIssueUrl(job);
280288

281289
return (
282290
<div className="max-w-3xl mx-auto px-6 py-12">
@@ -375,9 +383,9 @@ export default function JobDetailPage() {
375383
<div className="text-sm text-[var(--text-primary)] leading-relaxed whitespace-pre-wrap">
376384
{job.description || 'No description provided.'}
377385
</div>
378-
{job.metadata?.githubIssueUrl && typeof job.metadata.githubIssueUrl === 'string' && (
386+
{githubIssueUrl && (
379387
<a
380-
href={job.metadata.githubIssueUrl}
388+
href={githubIssueUrl}
381389
target="_blank"
382390
rel="noopener noreferrer"
383391
className="mt-3 inline-flex items-center gap-1.5 text-xs font-mono text-[var(--neon-cyan)] hover:underline"

0 commit comments

Comments
 (0)