mirror of
https://github.com/grafana/grafana.git
synced 2025-02-15 10:03:33 -06:00
* Initial commit, list and edit page working * Progress * angular and standard editors work * Unifying more between annotations list and links list * Remove submenu visibilty stuff * Update packages/grafana-data/src/types/annotations.ts Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> * Review feedback * fixed checkbox * Fixes * test(annotationsettings): initial commit of tests * delete files brought back by master merge * update datasourcepicker import path * update emotion import * test(linksettings): clean up tests * Fixed test * test(annotationssettings): add remaining tests * docs(grafana-data): export namespace for docs build * docs(grafana-ui): export ColorValueEditorProps for docs build * docs(grafana-ui): add docs annotation for ColorValueEditorProps Co-authored-by: Alex Khomenko <Clarity-89@users.noreply.github.com> Co-authored-by: Jack Westbrook <jack.westbrook@gmail.com>
24 lines
663 B
TypeScript
24 lines
663 B
TypeScript
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;
|
|
`,
|
|
});
|