Skip to content

Commit

Permalink
Add file lost in rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdavies committed Jun 21, 2019
1 parent 5e88843 commit 7027fbd
Showing 1 changed file with 37 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one
* or more contributor license agreements. Licensed under the Elastic License;
* you may not use this file except in compliance with the Elastic License.
*/

import React from 'react';
import { EuiPanel, EuiFieldText } from '@elastic/eui';
import { i18n } from '@kbn/i18n';
import { Action } from './state_management';

interface Props {
title: string;
dispatch: React.Dispatch<Action>;
children: React.ReactNode | React.ReactNode[];
}

export function WorkspacePanelWrapper({ children, title, dispatch }: Props) {
return (
<EuiPanel>
<header>
<EuiFieldText
placeholder={i18n.translate('xpack.lens.chartTitlePlaceholder', {
defaultMessage: 'Title',
})}
data-test-subj="lns_ChartTitle"
value={title}
onChange={e => dispatch({ type: 'UPDATE_TITLE', title: e.target.value })}
aria-label={i18n.translate('xpack.lens.chartTitleAriaLabel', {
defaultMessage: 'Title',
})}
/>
</header>
{children}
</EuiPanel>
);
}

0 comments on commit 7027fbd

Please sign in to comment.