Archived
1
0
Fork 0
This repository has been archived on 2024-04-05. You can view files and clone it, but cannot push or open issues or pull requests.
ethanreece.com/src/components/ButtonSecondary.astro
2023-06-09 14:07:08 -05:00

22 lines
609 B
Text

---
import { Icon } from 'astro-icon'
export interface Props {
link: string
icon?: string
external?: boolean
}
const { link, icon, external } = Astro.props
const buttonPaddingX = 'px-[.75rem]'
const buttonPaddingY = 'py-[.5rem]'
---
<a
href={link}
target={external ? '_blank' : '_self'}
rel={external ? 'noopener noreferrer' : ''}
class={`rounded hover:bg-background-hover hover:text-font-hover focus-visible:bg-background-hover focus-visible:text-font-hover focus-visible:outline-none ${buttonPaddingX} ${buttonPaddingY}`}
>
{icon && <Icon name={icon} />}
<slot />
</a>