import { css } from '@emotion/css'; import { uniqueId } from 'lodash'; import React, { HTMLProps, useRef } from 'react'; import { GrafanaTheme2 } from '@grafana/data'; import { Stack } from '@grafana/experimental'; import { Switch, useStyles2 } from '@grafana/ui'; export interface Props extends Omit, 'value' | 'ref'> { value?: boolean; label: string; } export function QueryHeaderSwitch({ label, ...inputProps }: Props) { const dashedLabel = label.replace(' ', '-'); const switchIdRef = useRef(uniqueId(`switch-${dashedLabel}`)); const styles = useStyles2(getStyles); return ( ); } const getStyles = (theme: GrafanaTheme2) => { return { switchLabel: css({ color: theme.colors.text.secondary, cursor: 'pointer', fontSize: theme.typography.bodySmall.fontSize, '&:hover': { color: theme.colors.text.primary, }, }), }; };