/** * @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 } from "preact"; import "ojs/ojbutton"; import { useState, useEffect } from "preact/hooks"; type Props = { create: () => void; edit: () => void; itemSelected: Partial; }; type Item = { id: number; name: string; short_desc?: string; price?: number; quantity?: number; quantity_shipped?: number; quantity_instock?: number; activity_id?: number; image?: string; }; const ItemActionsContainer = (props: Props) => { const [hideActions, setHideActions] = useState(true); if (props.itemSelected?.id) { console.log("Selected: " + JSON.stringify(props.itemSelected)); } useEffect(() => { if (props.itemSelected?.id) { setHideActions(false); } else { setHideActions(true); } }, [props.itemSelected]); return (
Create Update
); }; export default ItemActionsContainer;