mirror of
https://github.com/grafana/grafana.git
synced 2025-02-16 18:34:52 -06:00
* logs: context: allow "infinite" scroll * Log Context: Add visual changes to infinite scrolling (#70461) * remove text showing how many log lines are loaded * better positioning of loading indicators * add border * fix import * better loading states * improve corner cases * increase page size 10 => 50 * updated unit test, simplified code * fixed tests * updated tests * removed unused code * fixed test * improved refid-handling in loki * removed unnecessary code * better variable name * refactor * refactor --------- Co-authored-by: Sven Grossmann <sven.grossmann@grafana.com>
30 lines
631 B
TypeScript
30 lines
631 B
TypeScript
import { css } from '@emotion/css';
|
|
import React from 'react';
|
|
|
|
import { Spinner } from '@grafana/ui';
|
|
|
|
import { Place } from './types';
|
|
|
|
// ideally we'd use `@grafana/ui/LoadingPlaceholder`, but that
|
|
// one has a large margin-bottom.
|
|
|
|
type Props = {
|
|
place: Place;
|
|
};
|
|
|
|
export const LoadingIndicator = ({ place }: Props) => {
|
|
const text = place === 'above' ? 'Loading newer logs...' : 'Loading older logs...';
|
|
return (
|
|
<div className={loadingIndicatorStyles}>
|
|
<div>
|
|
{text} <Spinner inline />
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
const loadingIndicatorStyles = css`
|
|
display: flex;
|
|
justify-content: center;
|
|
`;
|