-
Notifications
You must be signed in to change notification settings - Fork 112
/
AlertDialogBody.tsx
37 lines (33 loc) · 1 KB
/
AlertDialogBody.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import * as React from 'react';
import PropTypes from 'prop-types';
import {Box, safelySpreadBoxProps} from '@twilio-paste/box';
import type {BoxProps} from '@twilio-paste/box';
import type {HTMLPasteProps} from '@twilio-paste/types';
export interface AlertDialogBodyProps extends HTMLPasteProps<'div'>, Pick<BoxProps, 'element'> {
bodyID: string;
children: NonNullable<React.ReactNode>;
}
export const AlertDialogBody = React.forwardRef<HTMLDivElement, AlertDialogBodyProps>(
({bodyID, children, element = 'ALERT_DIALOG_BODY', ...props}, ref) => {
return (
<Box
{...safelySpreadBoxProps(props)}
as="div"
overflowY="auto"
padding="space90"
paddingTop="space0"
element={element}
id={bodyID}
ref={ref}
>
{children}
</Box>
);
}
);
AlertDialogBody.displayName = 'AlertDialogBody';
AlertDialogBody.propTypes = {
bodyID: PropTypes.string.isRequired,
children: PropTypes.node.isRequired,
element: PropTypes.string,
};