Line data Source code
1 : /*
2 : * Copyright (C) 2023 Red Hat, Inc.
3 : * SPDX-License-Identifier: LGPL-2.1-or-later
4 : */
5 :
6 113 : import cockpit from "cockpit";
7 113 : import React from "react";
8 :
9 : import { CardBody } from "@patternfly/react-core/dist/esm/components/Card/index.js";
10 : import { DescriptionList } from "@patternfly/react-core/dist/esm/components/DescriptionList/index.js";
11 :
12 : import { StorageCard, StorageDescription, new_card } from "../pages.jsx";
13 : import { std_format_action } from "./actions.jsx";
14 : import { std_lock_action } from "../crypto/actions.jsx";
15 :
16 113 : const _ = cockpit.gettext;
17 :
18 2 : export function make_unrecognized_data_card(next, backing_block, content_block) {
19 2 : return new_card({
20 2 : title: _("Unrecognized data"),
21 2 : next,
22 2 : component: UnrecognizedDataCard,
23 2 : props: { backing_block, content_block },
24 2 : actions: [
25 2 : std_lock_action(backing_block, content_block),
26 2 : std_format_action(backing_block, content_block),
27 2 : ]
28 2 : });
29 2 : }
30 :
31 1 : export const UnrecognizedDataCard = ({ card, backing_block, content_block }) => {
32 1 : return (
33 1 : <StorageCard card={card}>
34 1 : <CardBody>
35 1 : <DescriptionList className="pf-m-horizontal-on-sm">
36 0 : <StorageDescription title={_("Usage")} value={content_block.IdUsage || "-"} />
37 0 : <StorageDescription title={_("Type")} value={content_block.IdType || "-"} />
38 1 : </DescriptionList>
39 1 : </CardBody>
40 1 : </StorageCard>
41 : );
42 1 : };
|