Debian Codegraph @

pkg/storaged/block/unrecognized-data.jsx

raw
1 /*
2 * Copyright (C) 2023 Red Hat, Inc.
3 * SPDX-License-Identifier: LGPL-2.1-or-later
4 */
5
6 import cockpit from "cockpit";
7 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 const _ = cockpit.gettext;
17
18 export function make_unrecognized_data_card(next, backing_block, content_block) {
19 return new_card({
20 title: _("Unrecognized data"),
21 next,
22 component: UnrecognizedDataCard,
23 props: { backing_block, content_block },
24 actions: [
25 std_lock_action(backing_block, content_block),
26 std_format_action(backing_block, content_block),
27 ]
28 });
29 }
30
31 export const UnrecognizedDataCard = ({ card, backing_block, content_block }) => {
32 return (
33 <StorageCard card={card}>
34 <CardBody>
35 <DescriptionList className="pf-m-horizontal-on-sm">
36 <StorageDescription title={_("Usage")} value={content_block.IdUsage || "-"} />
37 <StorageDescription title={_("Type")} value={content_block.IdType || "-"} />
38 </DescriptionList>
39 </CardBody>
40 </StorageCard>
41 );
42 };