refactor: remove unused props from components and improve error handling in about page (#385)

This commit is contained in:
Katsuyuki Karasawa
2025-04-08 22:44:52 +09:00
committed by GitHub
parent c8142d0ac5
commit 7ea2f7f40f
8 changed files with 11 additions and 12 deletions

View File

@@ -10,7 +10,7 @@ interface Props {
tags?: string[]
categories?: string[]
}
const { keyword, tags, categories } = Astro.props
const { tags, categories } = Astro.props
let posts = await getSortedPosts()

View File

@@ -5,7 +5,7 @@ interface Props {
href?: string
label?: string
}
const { size, dot, href, label }: Props = Astro.props
const { dot, href, label }: Props = Astro.props
---
<a href={href} aria-label={label} class="btn-regular h-8 text-sm px-3 rounded-lg">
{dot && <div class="h-1 w-1 bg-[var(--btn-content)] dark:bg-[var(--card-bg)] transition rounded-md mr-2"></div>}

View File

@@ -12,7 +12,7 @@ interface Props {
class: string
}
const { title, slug, pubDate } = Astro.props
const { title, pubDate } = Astro.props
const className = Astro.props.class
const profileConf = profileConfig
const licenseConf = licenseConfig

View File

@@ -3,7 +3,6 @@ import Profile from './Profile.astro'
import Tag from './Tags.astro'
import Categories from './Categories.astro'
import type { MarkdownHeading } from 'astro'
import TOC from './TOC.astro'
interface Props {
class? : string
@@ -11,7 +10,6 @@ interface Props {
}
const className = Astro.props.class
const headings = Astro.props.headings
---
<div id="sidebar" class:list={[className, "w-full"]}>

View File

@@ -10,7 +10,6 @@ interface Props {
class?: string
style?: string
}
const props = Astro.props
const { id, name, isCollapsed, collapsedHeight, style } = Astro.props
const className = Astro.props.class
---