mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* Add phlare datasource * Rename * Add parca * Add self field to parca * Make sure phlare works with add to dashboard flow * Add profiling category and hide behind feature flag * Update description and logos * Update phlare icon * Cleanup logging * Clean up logging * Fix for shift+enter * onRunQuery to set label * Update type naming * Fix lint * Fix test and quality issues Co-authored-by: Joey Tawadrous <joey.tawadrous@grafana.com>
31 lines
915 B
TypeScript
31 lines
915 B
TypeScript
import { css } from '@emotion/css';
|
|
import React, { CSSProperties, useCallback } from 'react';
|
|
|
|
import { GrafanaTheme2 } from '@grafana/data';
|
|
import { useStyles2 } from '@grafana/ui';
|
|
|
|
interface StackProps {
|
|
direction?: CSSProperties['flexDirection'];
|
|
alignItems?: CSSProperties['alignItems'];
|
|
wrap?: boolean;
|
|
gap?: number;
|
|
flexGrow?: CSSProperties['flexGrow'];
|
|
children: React.ReactNode;
|
|
}
|
|
|
|
export function Stack(props: StackProps) {
|
|
const styles = useStyles2(useCallback((theme) => getStyles(theme, props), [props]));
|
|
return <div className={styles.root}>{props.children}</div>;
|
|
}
|
|
|
|
const getStyles = (theme: GrafanaTheme2, props: StackProps) => ({
|
|
root: css({
|
|
display: 'flex',
|
|
flexDirection: props.direction ?? 'row',
|
|
flexWrap: props.wrap ?? true ? 'wrap' : undefined,
|
|
alignItems: props.alignItems,
|
|
gap: theme.spacing(props.gap ?? 2),
|
|
flexGrow: props.flexGrow,
|
|
}),
|
|
});
|