forked from grafana.jool/grafana-jool
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
663 B
23 lines
663 B
import React, { ButtonHTMLAttributes } from 'react';
|
|
import { Button, useStyles } from '@grafana/ui';
|
|
import { GrafanaTheme } from '@grafana/data';
|
|
import { css } from '@emotion/css';
|
|
|
|
export interface Props extends ButtonHTMLAttributes<HTMLButtonElement> {}
|
|
|
|
export const ListNewButton: React.FC<Props> = ({ children, ...restProps }) => {
|
|
const styles = useStyles(getStyles);
|
|
return (
|
|
<div className={styles.buttonWrapper}>
|
|
<Button icon="plus" variant="secondary" {...restProps}>
|
|
{children}
|
|
</Button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const getStyles = (theme: GrafanaTheme) => ({
|
|
buttonWrapper: css`
|
|
padding: ${theme.spacing.lg} 0;
|
|
`,
|
|
});
|
|
|