mirror of
https://github.com/misode/misode.github.io.git
synced 2026-04-24 07:37:10 +00:00
* Implement creating and importing new projects * Add downloading a zip of a project * Project validation (WIP) * Add project side panel, remove project pages * Project file saving * Add file tree actions to rename and delete * Fix file creation auto focus * Add button to save file from menu * Add project creation * Fix specificity on version switcher button * Update default version to 1.19 * List project files by type, remember project and delete project
19 lines
689 B
TypeScript
19 lines
689 B
TypeScript
import { Octicon } from '.'
|
|
|
|
type BtnProps = {
|
|
icon?: keyof typeof Octicon,
|
|
label?: string,
|
|
active?: boolean,
|
|
tooltip?: string,
|
|
tooltipLoc?: 'se' | 'sw' | 'nw',
|
|
class?: string,
|
|
onClick?: (event: MouseEvent) => unknown,
|
|
disabled?: boolean,
|
|
}
|
|
export function Btn({ icon, label, active, class: clazz, tooltip, tooltipLoc, onClick, disabled }: BtnProps) {
|
|
return <div class={`btn${active ? ' active' : ''}${clazz ? ` ${clazz}` : ''}${tooltip ? ` tooltipped tip-${tooltipLoc ?? 'sw'}` : ''}${disabled ? ' disabled' : ''}${active ? ' tip-shown' : ''}`} onClick={disabled ? undefined : onClick} aria-label={tooltip}>
|
|
{icon && Octicon[icon]}
|
|
{label && <span>{label}</span>}
|
|
</div>
|
|
}
|