PluginProbe
Code Snippets / 3.9.6
Code Snippets v3.9.6
4.0.0-beta.2 3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 All 65 releases
code-snippets / js / components / Import / shared / components / ImportCard.tsx

ImportCard.tsx in Code Snippets 3.9.6, at js/components/Import/shared/components/ImportCard.tsx

46 lines 883 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 import React from 'react'
2 import classnames from 'classnames'
3 import type { HTMLAttributes } from 'react'
4
5 export interface ImportCardProps extends Omit<HTMLAttributes<HTMLDivElement>, 'className'> {
6 children: React.ReactNode
7 className?: string
8 variant?: 'default' | 'controls'
9 }
10
11 export const ImportCard = React.forwardRef<HTMLDivElement, ImportCardProps>(({
12 children,
13 className,
14 variant = 'default',
15 style,
16 ...props
17 }, ref) => {
18 const cardStyle: React.CSSProperties = {
19 backgroundColor: '#ffffff',
20 padding: '25px',
21 borderRadius: '5px',
22 border: '1px solid #e0e0e0',
23 marginBottom: '10px',
24 width: '100%',
25 ...style
26 }
27
28 return (
29 <div
30 ref={ref}
31 className={classnames(
32 {
33 'import-controls': variant === 'controls'
34 },
35 className
36 )}
37 style={cardStyle}
38 {...props}
39 >
40 {children}
41 </div>
42 )
43 })
44
45 ImportCard.displayName = 'ImportCard'
46