refactor(ModsList, ReleaseNoteListItem): update interface usage for better type safety

This commit is contained in:
Shintaro Jokagi 2025-05-29 12:24:41 +12:00
parent 098e0eb9df
commit 1b7fafbb54
No known key found for this signature in database
GPG key ID: 0DDF8FA44C9A0DA8
2 changed files with 5 additions and 3 deletions

View file

@ -12,14 +12,14 @@ const defaultSortIcon = icon({ prefix: 'fas', iconName: 'sort' })
const ascSortIcon = icon({ prefix: 'fas', iconName: 'sort-up' })
const descSortIcon = icon({ prefix: 'fas', iconName: 'sort-down' })
interface ModsListProps {
interface Props {
allMods: ZenTheme[]
locale: Locale
// eslint-disable-next-line @typescript-eslint/no-explicit-any
translations: any
}
const { allMods, locale, translations } = Astro.props as ModsListProps
const { allMods, locale, translations } = Astro.props
const getLocalePath = getPath(locale)

View file

@ -1,7 +1,7 @@
---
import { getLocale, getUI } from '~/utils/i18n'
const { type, content, link } = Astro.props as {
interface Props {
type: 'security' | 'feature' | 'fix' | 'theme' | 'break' | 'known'
content: string
link?: {
@ -10,6 +10,8 @@ const { type, content, link } = Astro.props as {
} | null
}
const { type, content, link } = Astro.props as Props
const locale = getLocale(Astro)
const {