removes card header of root component

This commit is contained in:
Mose Müller 2024-02-19 10:19:11 +01:00
parent 838145a778
commit 8042f9b390

View File

@ -39,19 +39,16 @@ export const DataServiceComponent = React.memo(
displayName = webSettings[fullAccessPath].displayName; displayName = webSettings[fullAccessPath].displayName;
} }
return ( if (displayName !== '') {
<div className="component dataServiceComponent" id={id}> return (
<Card> <div className="component dataServiceComponent" id={id}>
<Card.Header <Card>
onClick={() => setOpen(!open)} <Card.Header onClick={() => setOpen(!open)} style={{ cursor: 'pointer' }}>
style={{ cursor: 'pointer' }} // Change cursor style on hover {displayName} {open ? <ChevronDown /> : <ChevronRight />}
> </Card.Header>
{displayName} {open ? <ChevronDown /> : <ChevronRight />} <Collapse in={open}>
</Card.Header> <Card.Body>
<Collapse in={open}> {Object.entries(props).map(([key, value]) => (
<Card.Body>
{Object.entries(props).map(([key, value]) => {
return (
<GenericComponent <GenericComponent
key={key} key={key}
attribute={value} attribute={value}
@ -60,12 +57,27 @@ export const DataServiceComponent = React.memo(
isInstantUpdate={isInstantUpdate} isInstantUpdate={isInstantUpdate}
addNotification={addNotification} addNotification={addNotification}
/> />
); ))}
})} </Card.Body>
</Card.Body> </Collapse>
</Collapse> </Card>
</Card> </div>
</div> );
); } else {
return (
<div className="component dataServiceComponent" id={id}>
{Object.entries(props).map(([key, value]) => (
<GenericComponent
key={key}
attribute={value}
name={key}
parentPath={fullAccessPath}
isInstantUpdate={isInstantUpdate}
addNotification={addNotification}
/>
))}
</div>
);
}
} }
); );