* fix(tracker): fix assist typings * fix(tracker): fix assist typings * change(ui) - preferences - removed old * change(ui) - preferences - wip * change(ui) - preferences - list * change(ui) - right box mardings * change(ui) - preferences - integration item paddings * change(ui) - preferences - integration icons * change(ui) - preferences - integration icons * change(ui) - preferences - integration - check status * change(ui) - preferences - integration - check status * change(ui) - preferences - metadata - move the delete button inside the modal * change(ui) - preferences - webhooks - modal and delete btn changes * change(ui) - preferences - modalContext updates * change(ui) - input field forward refs * change(ui) - metadata - modal * change(ui) - metadata - set deleting item to null * change(ui) - integrations * change(ui) - hoc withcopy * change(ui) - projects * change(ui) - users list modal * change(ui) - projects remove border for the last * change(ui) - integrations new api changes * change(ui) - github and jira changes * change(ui) - github and jira changes Co-authored-by: sylenien <nikita@openreplay.com>
41 lines
818 B
TypeScript
41 lines
818 B
TypeScript
import React from 'react';
|
|
|
|
interface Props {
|
|
children: React.ReactNode;
|
|
onSubmit?: any;
|
|
[x: string]: any;
|
|
}
|
|
|
|
interface FormFieldProps {
|
|
children: React.ReactNode;
|
|
[x: string]: any;
|
|
}
|
|
function FormField(props: FormFieldProps) {
|
|
const { children, ...rest } = props;
|
|
return (
|
|
<div {...rest} className="flex flex-col mb-4 form-field">
|
|
{children}
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function Form(props: Props) {
|
|
const { children, ...rest } = props;
|
|
return (
|
|
<form
|
|
{...rest}
|
|
onSubmit={(e) => {
|
|
e.preventDefault();
|
|
if (props.onSubmit) {
|
|
props.onSubmit(e);
|
|
}
|
|
}}
|
|
>
|
|
{children}
|
|
</form>
|
|
);
|
|
}
|
|
|
|
Form.Field = FormField;
|
|
|
|
export default Form;
|