www/src/components/BackButton.astro

23 lines
464 B
Text

---
import ArrowLeftIcon from '~/icons/ArrowLeftIcon.astro'
import { getLocale, getUI } from '~/utils/i18n'
const locale = getLocale(Astro)
const {
routes: {
mods: { slug },
},
} = getUI(locale)
const { href, ...props } = Astro.props
if (!href) {
console.error('BackButton: href is required')
}
---
<a href={href} class="mb-8 flex w-fit items-center gap-2" {...props} data-testid="back-button">
<ArrowLeftIcon class="size-4" />
{slug.back}
</a>