mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
32 lines
849 B
TypeScript
32 lines
849 B
TypeScript
import React, { FC } from 'react';
|
|
|
|
export interface Props {
|
|
isReadOnly: boolean;
|
|
onDelete: () => void;
|
|
onSubmit: (event) => void;
|
|
onTest: (event) => void;
|
|
}
|
|
|
|
const ButtonRow: FC<Props> = ({ isReadOnly, onDelete, onSubmit, onTest }) => {
|
|
return (
|
|
<div className="gf-form-button-row">
|
|
<button type="submit" className="btn btn-success" disabled={isReadOnly} onClick={event => onSubmit(event)}>
|
|
Save & Test
|
|
</button>
|
|
{isReadOnly && (
|
|
<button type="submit" className="btn btn-success" onClick={onTest}>
|
|
Test
|
|
</button>
|
|
)}
|
|
<button type="submit" className="btn btn-danger" disabled={isReadOnly} onClick={onDelete}>
|
|
Delete
|
|
</button>
|
|
<a className="btn btn-inverse" href="/datasources">
|
|
Back
|
|
</a>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default ButtonRow;
|