import { FC, useMemo, useRef } from 'react'; import { Column, ColumnProps } from '..'; import { DraggableWindow, DraggableWindowPosition, DraggableWindowProps } from '../draggable-window'; import { NitroCardContextProvider } from './NitroCardContext'; export interface NitroCardViewProps extends DraggableWindowProps, ColumnProps { theme?: string; isResizable?: boolean; } export const NitroCardView: FC = props => { const { theme = 'primary', uniqueKey = null, handleSelector = '.drag-handler', windowPosition = DraggableWindowPosition.CENTER, disableDrag = false, overflow = 'hidden', position = 'relative', gap = 0, classNames = [], isResizable = true, ...rest } = props; const elementRef = useRef(null); const getClassNames = useMemo(() => { const newClassNames: string[] = [ isResizable ? 'resize' : 'resize-none', 'nitro-card-shell' ]; if(classNames.length) newClassNames.push(...classNames); return newClassNames; }, [ classNames, isResizable ]); return ( ); };