OutlineBox: allow passing div props through
This commit is contained in:
parent
5297227501
commit
ca4a5370c1
1 changed files with 6 additions and 3 deletions
|
@ -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>
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue