Skip to content

Commit

Permalink
Fix typescript showing useless errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Bo-Duke committed Feb 6, 2025
1 parent d2edb1e commit 983d13a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/app/[locale]/map/observation/[path]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default async function ObservationPage({ params: { path } }: Props) {
<section className="p-4 lg:p-8">
<header className="flex items-center justify-between pb-8">
<h1 className="text-3xl font-extrabold tracking-tight lg:text-4xl">
{isDefaultObservation ? t(`${path}.label`) : observation.label}
{isDefaultObservation ? t(`${path}.label`) : observation?.label}
</h1>
<div className="absolute right-0 top-0 flex rounded-bl-lg border border-t-0 bg-background">
<ButtonClose label={t('cancel')} />
Expand All @@ -51,7 +51,7 @@ export default async function ObservationPage({ params: { path } }: Props) {
<p className="pb-8">
{isDefaultObservation
? t(`${path}.description`)
: observation.description}
: observation?.description}
</p>

{isDefaultObservation ? (
Expand All @@ -61,10 +61,10 @@ export default async function ObservationPage({ params: { path } }: Props) {
/>
) : (
<CustomObservationForm
id={observation.id}
id={observation?.id}
schema={jsonSchema}
stations={observation.stations}
passwordProtected={!!observation.password_required}
stations={observation?.stations}
passwordProtected={!!observation?.password_required}
handleSubmitObservation={handleSubmitCustomObservation}
/>
)}
Expand Down

0 comments on commit 983d13a

Please sign in to comment.