Files
grafana/public/app/features/plugins/admin/hooks/usePluginPageExtensions.tsx
Ashley Harrison 159607fe6f Navigation: Convert PluginDetails page to use new Page extensions (#58509)
* Added labels

* App page fixes

* Switch to switch

* wip

* Updates

* I am stuck

* Minor tweak

* This props interface could work

* removed change

* use new page extensions in plugin details page

* add link separator, fix action button spacing

* some renaming

* Move PageInfo into it's own folder + add tests

* add support for new props in old page header

* remove PluginDetailsHeader as it's no longer used

* Fix unit tests

* fix some badge alignments

* center align actions

* badge alignment + only show downloads for community/commercial plugins

* better link alignment

* conditionally render description

* move install control warnings to below subtitle + refactor

Co-authored-by: Torkel Ödegaard <torkel@grafana.com>
2022-11-09 14:44:38 +00:00

25 lines
668 B
TypeScript

import React from 'react';
import { PageInfoItem } from '../../../../core/components/Page/types';
import { PluginActions } from '../components/PluginActions';
import { PluginSubtitle } from '../components/PluginSubtitle';
import { CatalogPlugin } from '../types';
import { usePluginInfo } from './usePluginInfo';
type ReturnType = {
actions: React.ReactNode;
info: PageInfoItem[];
subtitle: React.ReactNode;
};
export const usePluginPageExtensions = (plugin?: CatalogPlugin): ReturnType => {
const info = usePluginInfo(plugin);
return {
actions: <PluginActions plugin={plugin} />,
info,
subtitle: <PluginSubtitle plugin={plugin} />,
};
};