mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-23 23:27:09 +00:00
Switch to vite and preact
This commit is contained in:
15
src/app/components/Btn.tsx
Normal file
15
src/app/components/Btn.tsx
Normal file
@@ -0,0 +1,15 @@
|
||||
import { Octicon } from '.'
|
||||
|
||||
type BtnProps = {
|
||||
icon?: keyof typeof Octicon,
|
||||
label?: string,
|
||||
active?: boolean,
|
||||
class?: string,
|
||||
onClick?: (event: MouseEvent) => unknown,
|
||||
}
|
||||
export function Btn({ icon, label, active, class: class_, onClick }: BtnProps) {
|
||||
return <div class={`btn${active ? ' active' : ''}${class_ ? ` ${class_}` : ''}`} onClick={onClick}>
|
||||
{icon && Octicon[icon]}
|
||||
{label && <span>{label}</span>}
|
||||
</div>
|
||||
}
|
||||
Reference in New Issue
Block a user