Files
2024-02-15 17:01:50 +00:00

34 lines
716 B
TypeScript

import type {LegacyRef, ReactChild} from 'react';
import styled from '@emotion/styled';
type Props = {
children: ReactChild;
bodyRef?: LegacyRef<HTMLDivElement> | undefined;
bottom?: ReactChild;
className?: string;
title?: ReactChild;
};
function FluidPanel({className, children, bottom, title, bodyRef}: Props) {
return (
<FluidContainer className={className}>
{title}
<OverflowBody ref={bodyRef}>{children}</OverflowBody>
{bottom}
</FluidContainer>
);
}
const FluidContainer = styled('section')`
display: grid;
grid-template-rows: auto 1fr auto;
height: 100%;
`;
const OverflowBody = styled('div')`
height: 100%;
overflow: auto;
`;
export default FluidPanel;