mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-09-12 17:45:22 +00:00
This makes the code a bit shorter by not having to use `props.` all of the time. Also make everything VoidFunctionComponent while we are touching this.
26 lines
663 B
TypeScript
26 lines
663 B
TypeScript
// SPDX-License-Identifier: MIT
|
|
// Copyright (c) 2021-2022 The Pybricks Authors
|
|
|
|
import React from 'react';
|
|
import ActionButton, { ActionButtonProps } from '../toolbar/ActionButton';
|
|
import { TooltipId } from '../toolbar/i18n';
|
|
import settingsIcon from './settings.svg';
|
|
|
|
type SettingsButtonProps = Pick<ActionButtonProps, 'id' | 'onAction'>;
|
|
|
|
const SettingsButton: React.VoidFunctionComponent<SettingsButtonProps> = ({
|
|
id,
|
|
onAction,
|
|
}) => {
|
|
return (
|
|
<ActionButton
|
|
id={id}
|
|
tooltip={TooltipId.Settings}
|
|
icon={settingsIcon}
|
|
onAction={onAction}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default SettingsButton;
|