1import React, { ButtonHTMLAttributes } from 'react'; 2import { Button, useStyles } from '@grafana/ui'; 3import { GrafanaTheme } from '@grafana/data'; 4import { css } from '@emotion/css'; 5 6export interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {} 7 8export const ListNewButton: React.FC<Props> = ({ children, ...restProps }) => { 9 const styles = useStyles(getStyles); 10 return ( 11 <div className={styles.buttonWrapper}> 12 <Button icon="plus" variant="secondary" {...restProps}> 13 {children} 14 </Button> 15 </div> 16 ); 17}; 18 19const getStyles = (theme: GrafanaTheme) => ({ 20 buttonWrapper: css` 21 padding: ${theme.spacing.lg} 0; 22 `, 23}); 24