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;
} }
if (displayName !== '') {
return ( return (
<div className="component dataServiceComponent" id={id}> <div className="component dataServiceComponent" id={id}>
<Card> <Card>
<Card.Header <Card.Header onClick={() => setOpen(!open)} style={{ cursor: 'pointer' }}>
onClick={() => setOpen(!open)}
style={{ cursor: 'pointer' }} // Change cursor style on hover
>
{displayName} {open ? <ChevronDown /> : <ChevronRight />} {displayName} {open ? <ChevronDown /> : <ChevronRight />}
</Card.Header> </Card.Header>
<Collapse in={open}> <Collapse in={open}>
<Card.Body> <Card.Body>
{Object.entries(props).map(([key, value]) => { {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>
);
}
} }
); );