// This file is part of Coog. The COPYRIGHT file at the top level of // this repository contains the full copyright notices and license terms. import React from 'react'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faPause, faPlay, faStop } from '@fortawesome/free-solid-svg-icons'; import { SRHeaderProps } from './SRHeader.types'; import Button from '../../Button'; import './SRHeader.scss'; /** * @description Heaader block of EditSalesRoute view * * @param {string} title * @param {string} buttons * @param {string} status "play" | "pause" | "stop" | "file-export"; * @callback eventEmitter */ const SRHeader = ({ title, buttons = [], eventEmitter, status = undefined }: SRHeaderProps): JSX.Element => { /** * handle click event * @param {number} id */ const handleClick = (id: number) => { eventEmitter(id); }; /** * return icon * @param {string} icon */ let icon = null; switch (status) { case 'pause': icon = faPause; break; case 'play': icon = faPlay; break; case 'stop': icon = faStop; break; default: break; } return (

{title}

{icon && (
)}
{buttons.map(button => (
))}
); }; export default SRHeader;