grafana/public/app/features/dashboard/dashgrid/PanelOptionSection.tsx
2018-12-14 09:44:48 +01:00

27 lines
664 B
TypeScript

// Libraries
import React, { SFC } from 'react';
interface Props {
title?: string;
onClose?: () => void;
children: JSX.Element | JSX.Element[];
}
export const PanelOptionSection: SFC<Props> = props => {
return (
<div className="panel-option-section">
{props.title && (
<div className="panel-option-section__header">
{props.title}
{props.onClose && (
<button className="btn btn-link" onClick={props.onClose}>
<i className="fa fa-remove" />
</button>
)}
</div>
)}
<div className="panel-option-section__body">{props.children}</div>
</div>
);
};