import {Component} from 'react';
import {action} from '@storybook/addon-actions';
import PropTypes from 'prop-types';
import {
Form as LegacyForm,
TextField as LegacyTextField,
} from 'sentry/components/deprecatedforms';
class UndoButton extends Component {
handleClick(e) {
e.preventDefault();
this.context.form.undo();
}
render() {
return (
);
}
}
UndoButton.contextTypes = {
form: PropTypes.object,
};
export default {
title: 'Deprecated/Form',
};
export const Empty = () => ;
Empty.storyName = 'empty';
export const WithCancel = () => (
);
WithCancel.storyName = 'with Cancel';
WithCancel.parameters = {
docs: {
description: {
story: 'Adds a "Cancel" button when `onCancel` is defined',
},
},
};
export const SaveOnBlurAndUndo = () => (
);
SaveOnBlurAndUndo.storyName = 'save on blur and undo';
SaveOnBlurAndUndo.parameters = {
docs: {
description: {
story: 'Saves on blur and has undo',
},
},
};