OutlineBox: allow passing div props through

This commit is contained in:
Alex Gleason 2022-09-16 13:34:53 -05:00
parent 5297227501
commit ca4a5370c1
No known key found for this signature in database
GPG key ID: 7211D1F99744FBB7

View file

@ -1,15 +1,18 @@
import classNames from 'clsx'; import classNames from 'clsx';
import React from 'react'; import React from 'react';
interface IOutlineBox { interface IOutlineBox extends React.HTMLAttributes<HTMLDivElement> {
children: React.ReactNode, children: React.ReactNode,
className?: string, className?: string,
} }
/** Wraps children in a container with an outline. */ /** Wraps children in a container with an outline. */
const OutlineBox: React.FC<IOutlineBox> = ({ children, className }) => { const OutlineBox: React.FC<IOutlineBox> = ({ children, className, ...rest }) => {
return ( return (
<div className={classNames('p-4 rounded-lg border border-solid border-gray-300 dark:border-gray-800', className)}> <div
className={classNames('p-4 rounded-lg border border-solid border-gray-300 dark:border-gray-800', className)}
{...rest}
>
{children} {children}
</div> </div>
); );