import React from 'react'; import { Segment, Table } from 'semantic-ui-react'; import * as ApiUtils from '../CloudApi/ApiUtils.js'; import InventoryWrapper from './InventoryWrapper.jsx'; export default class BigProductCustomsInfo extends React.Component { constructor(props) { super(props); this.state = { loading: true, schemas: null }; } async componentDidMount() { try { let schemas = await ApiUtils.getFabricatorSchemas(); this.setState({ schemas, loading: false }); } catch (e) { console.log(e); this.setState({ loading: false }); } } render() { const { schemas, loading } = this.state; if (loading) { return ( ); } const customsInfo = schemas?.BigProductTypeCustomsInfo || {}; const productTypes = Object.keys(customsInfo).sort(); return ( Product Type Tariff Number Description Weight Mass Unit Default Value {productTypes.map(productType => { const info = customsInfo[productType]; return ( {productType} {info.tariffNumber} {info.description} {info.weight} {info.massUnit} ${info.defaultValue.toFixed(2)} ); })}
{productTypes.length === 0 && (

No customs information available.

)}
); } }