* refactor(css): only load base styles, add css task, cleanup exports * style(base): add edge label bg * refactor(css): use css-utils * feat(core): add Panel component * refactor(background): cleanup * refactor(css-handling): cleanup
22 lines
530 B
TypeScript
22 lines
530 B
TypeScript
import React, { HTMLAttributes, ReactNode } from 'react';
|
|
import cc from 'classcat';
|
|
|
|
import { PanelPosition } from '../../types';
|
|
|
|
export type PanelProps = HTMLAttributes<HTMLDivElement> & {
|
|
position: PanelPosition;
|
|
children: ReactNode;
|
|
};
|
|
|
|
function Panel({ position, children, className, ...rest }: PanelProps) {
|
|
const positionClasses = `${position}`.split('-');
|
|
|
|
return (
|
|
<div className={cc(['react-flow__panel', className, ...positionClasses])} {...rest}>
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default Panel;
|