Files
grafana/public/app/plugins/datasource/stackdriver/components/Project.tsx
Peter Holmberg 4898502e4e refactor(grafana/ui): Replace <input />with Input component from grafana/ui (#16085)
* replace with Input component from grafana/ui

* removing placeholder classname

* change import

* fix import
2019-03-25 15:53:05 +01:00

33 lines
789 B
TypeScript

import React from 'react';
import { Input } from '@grafana/ui';
import StackdriverDatasource from '../datasource';
export interface Props {
datasource: StackdriverDatasource;
}
interface State {
projectName: string;
}
export class Project extends React.Component<Props, State> {
state: State = {
projectName: 'Loading project...',
};
async componentDidMount() {
const projectName = await this.props.datasource.getDefaultProject();
this.setState({ projectName });
}
render() {
const { projectName } = this.state;
return (
<div className="gf-form">
<span className="gf-form-label width-9 query-keyword">Project</span>
<Input className="gf-form-input width-15" disabled type="text" value={projectName} />
</div>
);
}
}