Files
pybricks-code/src/settings/SettingsButton.tsx
T
David Lechner 8e4045449c src: use prop unpacking pattern
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.
2022-03-12 16:07:31 -06:00

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;