more api cleanup

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2022-08-18 14:11:45 +02:00
parent e195112c5c
commit 3f739be9d9
88 changed files with 358 additions and 594 deletions
@@ -23,15 +23,12 @@ import { ScorecardInfo } from '../ScorecardsInfo';
import Alert from '@material-ui/lab/Alert';
import { techInsightsApiRef } from '../../api/TechInsightsApi';
export const ScorecardsCard = ({
title,
description,
checksId,
}: {
export const ScorecardsCard = (props: {
title?: string;
description?: string;
checksId?: string[];
}) => {
const { title, description, checksId } = props;
const api = useApi(techInsightsApiRef);
const { namespace, kind, name } = useParams();
const { value, loading, error } = useAsync(
@@ -31,15 +31,12 @@ const useStyles = makeStyles(() => ({
},
}));
export const ScorecardsContent = ({
title,
description,
checksId,
}: {
export const ScorecardsContent = (props: {
title?: string;
description?: string;
checksId?: string[];
}) => {
const { title, description, checksId } = props;
const classes = useStyles();
const api = useApi(techInsightsApiRef);
const { namespace, kind, name } = useParams();
@@ -30,15 +30,9 @@ const useStyles = makeStyles((theme: BackstageTheme) => ({
},
}));
type Checks = {
checks: CheckResult[];
title?: string;
description?: string;
};
const infoCard = (
title: Checks['title'],
description: Checks['description'],
title: string | undefined,
description: string | undefined,
className: string,
element: JSX.Element,
) => (
@@ -54,7 +48,12 @@ const infoCard = (
</Grid>
);
export const ScorecardInfo = ({ checks, title, description }: Checks) => {
export const ScorecardInfo = (props: {
checks: CheckResult[];
title?: string;
description?: string;
}) => {
const { checks, title, description } = props;
const classes = useStyles();
const api = useApi(techInsightsApiRef);