mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-27 08:48:46 +00:00
16 lines
427 B
TypeScript
16 lines
427 B
TypeScript
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>
|
|
}
|