/** * @license * Copyright (c) 2014, 2024, Oracle and/or its affiliates. * Licensed under The Universal Permissive License (UPL), Version 1.0 * as shown at https://oss.oracle.com/licenses/upl/ * @ignore */ import { h, ComponentProps } from "preact"; import MutableArrayDataProvider = require("ojs/ojmutablearraydataprovider"); import "ojs/ojchart"; import { ojChart } from "ojs/ojchart"; import "ojs/ojavatar"; type Props = { item?: Item | null; }; type Item = { id: number; name: string; short_desc?: string; price?: number; quantity?: number; quantity_shipped?: number; quantity_instock?: number; activity_id?: number; image?: string; }; type ChartItem = { id: number; series: string; group: string; value: number; }; type ChartProps = ComponentProps<"oj-chart">; const ItemDetailContainer = (props: Props) => { const chartItem = ( item: ojChart.ItemTemplateContext ) => { return ( ); }; const pieDataProvider: MutableArrayDataProvider = new MutableArrayDataProvider( [ { series: "Quantity in Stock", value: props.item?.quantity_instock }, { series: "Quantity shipped", value: props.item?.quantity_shipped }, ], { keyAttributes: "id" } ); return (

Item Details


{props.item?.name}
{props.item?.short_desc}
{"Price: " + props.item?.price + " each"}
{"Item Id: " + props.item?.id}
); } export default ItemDetailContainer;