Yes, let's adjust the Offcanvas styling to better fit the table content. Here's a more refined approach focusing just on the Offcanvas and its immediate container elements:
<Offcanvas
direction="end"
scrollable={true}
backdrop={false}
isOpen={toggled}
style={{
width: '75vw', // Slightly reduced from 80vw to prevent overwhelming the screen
height: '85vh', // Slightly reduced from 90vh
maxWidth: '75vw',
maxHeight: '85vh',
margin: '2vh auto', // Centers vertically with some space from top/bottom
}}>
<div style={{
display: 'flex',
flexDirection: 'column',
height: '100%', // Takes full height of Offcanvas
}}>
<OffcanvasHeader className="bg-primary text-white" toggle={closeModal}>
<div className="d-flex align-items-baseline">
<span>{title}</span>
</div>
</OffcanvasHeader>
<div style={{
flex: 1, // Takes remaining space
overflow: 'auto', // Enables scrolling if content overflows
padding: '1rem',
}}>
<Panel
testId="event-log-panel"
title=""
loading={eventlogs.isInitialLoading}
fetching={eventlogs.isFetching}
error={eventlogs.error?.message}>
<PanelContent testId="event-log-panel-content">
<Row className="mb-3">
<Col md={6} lg={4}>
<Input
type="text"
value={searchFilter}
onChange={(e) => setSearchFilter(e.target.value)}
placeholder="Search Event Logs"
/>
</Col>
</Row>
<ReactTable
testId="event-log-table"
hover
columns={tableColumns}
data={tableData}
emptyTableMessage="No event logs found."
showFooter={true}
filters={filters}
hiddenColumns={hiddenColumns}
/>
</PanelContent>
</Panel>
</div>
</div>
</Offcanvas>
Key changes:
- Used flexbox to create a more responsive layout
- Adjusted the overall dimensions to be slightly smaller
- Added margin to center the Offcanvas vertically
- Made the content area flex to take remaining space
- Removed fixed width/height constraints that might cause extra whitespace
Would you like to try this adjustment and let me know if it better fits your needs? We can further fine-tune the spacing if needed.