/*
 * Copyright (c) 2015 Nordic Semiconductor ASA
 *
 * SPDX-License-Identifier: LicenseRef-Nordic-4-Clause
 */

import React, { type FC } from 'react';
import ButtonGroup from 'react-bootstrap/ButtonGroup';

import { type Device } from '../../deviceSlice';
import { MakeDeviceFavorite } from '../Favorite';
import RenameDevice from './RenameDevice';

import './edit-device-buttons.scss';

interface Props {
    device: Device;
    startEditingDeviceName: () => void;
}

const EditDeviceButtons: FC<Props> = ({ device, startEditingDeviceName }) =>
    device.serialNumber ? (
        <ButtonGroup className="edit-device-buttons">
            <MakeDeviceFavorite device={device} />
            <RenameDevice startEditingDeviceName={startEditingDeviceName} />
        </ButtonGroup>
    ) : null;

export default EditDeviceButtons;
