@jjlmoya/utils-astronomy 1.34.1 → 1.35.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jjlmoya/utils-astronomy",
3
- "version": "1.34.1",
3
+ "version": "1.35.1",
4
4
  "type": "module",
5
5
  "main": "./src/index.ts",
6
6
  "types": "./src/index.ts",
@@ -1,14 +1,14 @@
1
1
  ---
2
2
  import { Bibliography as SharedBibliography } from '@jjlmoya/utils-shared';
3
3
  import { meteorShowerObservingPlanner } from './index';
4
+ import type { KnownLocale } from '../../types';
4
5
 
5
6
  interface Props {
6
- locale: string;
7
+ locale?: KnownLocale;
7
8
  }
8
9
 
9
- const { locale } = Astro.props;
10
- const entry = await meteorShowerObservingPlanner.i18n[locale as keyof typeof meteorShowerObservingPlanner.i18n]();
11
- const content = entry();
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await meteorShowerObservingPlanner.i18n[locale]?.();
12
12
  ---
13
13
 
14
- <SharedBibliography links={content.bibliography} />
14
+ {content && <SharedBibliography links={content.bibliography} />}
@@ -1,14 +1,15 @@
1
1
  ---
2
2
  import { SEORenderer } from '@jjlmoya/utils-shared';
3
3
  import { meteorShowerObservingPlanner } from './index';
4
+ import type { KnownLocale } from '../../types';
4
5
 
5
6
  interface Props {
6
- locale: string;
7
+ locale?: KnownLocale;
7
8
  }
8
9
 
9
- const { locale } = Astro.props;
10
- const entry = await meteorShowerObservingPlanner.i18n[locale as keyof typeof meteorShowerObservingPlanner.i18n]();
11
- const content = entry();
10
+ const { locale = 'es' } = Astro.props;
11
+ const content = await meteorShowerObservingPlanner.i18n[locale]?.();
12
+ if (!content) return null;
12
13
  ---
13
14
 
14
- <SEORenderer locale={locale} sections={content.seo} />
15
+ <SEORenderer content={{ locale, sections: content.seo }} />