mirror of
https://github.com/Kong/insomnia
synced 2024-11-08 23:00:30 +00:00
5f4c19da35
Co-authored-by: Opender Singh <opender.singh@konghq.com>
36 lines
929 B
TypeScript
36 lines
929 B
TypeScript
import classnames from 'classnames';
|
|
import React from 'react';
|
|
|
|
interface PaneProps {
|
|
className?: string;
|
|
type: 'request' | 'response';
|
|
}
|
|
|
|
interface PaneHeaderProps {
|
|
className?: string;
|
|
}
|
|
|
|
interface PaneBodyProps {
|
|
className?: string;
|
|
placeholder?: boolean;
|
|
}
|
|
|
|
export const Pane: React.FC<PaneProps> = ({ className, type, children }) => (
|
|
<section className={classnames(`${type}-pane`, 'theme--pane', 'pane', className)}>
|
|
{children}
|
|
</section>
|
|
);
|
|
|
|
export const PaneHeader: React.FC<PaneHeaderProps> = ({ className, children }) => (
|
|
<header className={classnames('pane__header', 'theme--pane__header', className)}>
|
|
{children}
|
|
</header>
|
|
);
|
|
|
|
export const paneBodyClasses = 'pane__body theme--pane__body';
|
|
export const PaneBody: React.FC<PaneBodyProps> = ({ placeholder, children }) => (
|
|
<div className={classnames(paneBodyClasses, placeholder && 'pane__body--placeholder')}>
|
|
{children}
|
|
</div>
|
|
);
|