jobiqo-cl
Version:
[](https://circleci.com/gh/jobiqo/jobiqo-cl)
35 lines (32 loc) • 892 B
JavaScript
import React__default from 'react';
import styled from 'styled-components';
/**
* @file index.tsx
*
* @fileoverview A wrapper to include multiple form actions inside.
*/
const StyledFormActionsWrapper = styled.div `
display: flex;
button {
${props => props.orientation === 'left'
? `
margin-left: 1rem;
&:first-child {
margin: 0;
}
`
: `
&:last-child {
margin: 0;
}
margin-right: 1rem;`}
}
`;
/**
* The form actions component allows grouping multiple form actions.
* Usefull to group together a submit and cancel button on a form for example.
*/
const FormActions = ({ children, orientation = 'left' }) => {
return (React__default.createElement(StyledFormActionsWrapper, { orientation: orientation }, children));
};
export { FormActions, StyledFormActionsWrapper };