mirror of
https://github.com/whscullin/apple2js.git
synced 2024-01-12 14:14:38 +00:00
25 lines
598 B
TypeScript
25 lines
598 B
TypeScript
|
import { h, JSX } from 'preact';
|
||
|
|
||
|
/**
|
||
|
* Interface for ControlButton.
|
||
|
*/
|
||
|
export interface ControlButtonProps {
|
||
|
icon: string;
|
||
|
title: string;
|
||
|
onClick: JSX.MouseEventHandler<HTMLButtonElement>;
|
||
|
}
|
||
|
|
||
|
/**
|
||
|
* Simple button with an icon, tooltip text and a callback.
|
||
|
*
|
||
|
* @param icon FontAwesome icon name
|
||
|
* @param title Tooltip text
|
||
|
* @param onClick Click callback
|
||
|
* @returns Control Button component
|
||
|
*/
|
||
|
export const ControlButton = ({ icon, title, onClick }: ControlButtonProps) => (
|
||
|
<button onClick={onClick} title={title}>
|
||
|
<i class={`fas fa-${icon}`}></i>
|
||
|
</button>
|
||
|
);
|