mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
* cleanup tests * more cleanup * added links * test legacy hooks * test legacy hooks * update codeowners * revert package changes * add project specfic example script * remove console log * Update .github/CODEOWNERS Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com> * Update CODEOWNERS * use correct file names * cleanup tests --------- Co-authored-by: Timur Olzhabayev <timur.olzhabayev@grafana.com>
26 lines
711 B
TypeScript
26 lines
711 B
TypeScript
import { PluginPage, usePluginLinks } from '@grafana/runtime';
|
|
|
|
import { testIds } from '../testIds';
|
|
|
|
export const LINKS_EXTENSION_POINT_ID = 'plugins/grafana-extensionstest-app/use-plugin-links/v1';
|
|
|
|
export function AddedLinks() {
|
|
const { links, isLoading } = usePluginLinks({ extensionPointId: LINKS_EXTENSION_POINT_ID });
|
|
|
|
return (
|
|
<PluginPage>
|
|
<div data-testid={testIds.addedLinksPage.container}>
|
|
{isLoading ? (
|
|
<div>Loading...</div>
|
|
) : (
|
|
links.map(({ id, title, path, onClick }) => (
|
|
<a href={path} title={title} key={id} onClick={onClick}>
|
|
{title}
|
|
</a>
|
|
))
|
|
)}
|
|
</div>
|
|
</PluginPage>
|
|
);
|
|
}
|