| 1 |
import React, { forwardRef } from 'react' |
| 2 |
import classnames from 'classnames' |
| 3 |
import type { HTMLAttributes, ReactNode } from 'react' |
| 4 |
|
| 5 |
export interface ImportCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> { |
| 6 |
children: ReactNode |
| 7 |
className?: string |
| 8 |
variant?: 'default' | 'controls' |
| 9 |
} |
| 10 |
|
| 11 |
export const ImportCard = forwardRef<HTMLDivElement, ImportCardProps>(({ |
| 12 |
children, |
| 13 |
className, |
| 14 |
variant = 'default', |
| 15 |
...props |
| 16 |
}, ref) => |
| 17 |
<div |
| 18 |
ref={ref} |
| 19 |
className={classnames( |
| 20 |
'import-snippets-card', |
| 21 |
{ 'import-controls': 'controls' === variant }, |
| 22 |
className |
| 23 |
)} |
| 24 |
{...props} |
| 25 |
> |
| 26 |
{children} |
| 27 |
</div>) |
| 28 |
|
| 29 |
ImportCard.displayName = 'ImportCard' |
| 30 |
|