import { useState } from 'react'; import React from 'react'; import { Card, Collapse } from 'react-bootstrap'; import { ChevronDown, ChevronRight } from 'react-bootstrap-icons'; import { SerializedValue, GenericComponent } from './GenericComponent'; import { LevelName } from './NotificationsComponent'; type DataServiceProps = { name: string; props: DataServiceJSON; parentPath?: string; isInstantUpdate: boolean; addNotification: (message: string, levelname?: LevelName) => void; displayName: string; id: string; }; export type DataServiceJSON = Record; export const DataServiceComponent = React.memo( ({ name, props, parentPath = undefined, isInstantUpdate, addNotification, displayName, id }: DataServiceProps) => { const [open, setOpen] = useState(true); const fullAccessPath = [parentPath, name].filter((element) => element).join('.'); if (displayName !== '') { return (
setOpen(!open)} style={{ cursor: 'pointer' }}> {displayName} {open ? : } {Object.entries(props).map(([key, value]) => ( ))}
); } else { return (
{Object.entries(props).map(([key, value]) => ( ))}
); } } );