feat(plugins/pagerduty): add wrapper BasicCard component

* ensures errors and progress bar have consistent styling with the rest
  of the Overview Page components

Signed-off-by: Alec Jacobs <cajacobs5401@gmail.com>
This commit is contained in:
Alec Jacobs
2022-05-27 10:39:06 -07:00
parent 3cf02b6e9c
commit bb4fb80dac
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import React, { useState, useCallback } from 'react';
import React, { ReactNode, useState, useCallback } from 'react';
import { Entity } from '@backstage/catalog-model';
import { Card, CardHeader, Divider, CardContent } from '@material-ui/core';
import { Incidents } from '../Incident';
@@ -37,8 +37,13 @@ import {
IconLinkVerticalProps,
TabbedCard,
CardTab,
InfoCard,
} from '@backstage/core-components';
const BasicCard = ({ children }: { children: ReactNode }) => (
<InfoCard title="PagerDuty">{children}</InfoCard>
);
export const isPluginApplicableToEntity = (entity: Entity) =>
Boolean(
entity.metadata.annotations?.[PAGERDUTY_INTEGRATION_KEY] ||
@@ -96,7 +101,11 @@ export const PagerDutyCard = () => {
}
if (loading) {
return <Progress />;
return (
<BasicCard>
<Progress />
</BasicCard>
);
}
const serviceLink: IconLinkVerticalProps = {