import { Button } from '@bjsdistribution/dms-component-library';
import React from 'react';
import styled from 'styled-components';

interface FooterProps {
  submitButtonTitle?: string;
  cancelButtonTitle?: string;
  actions?: React.ReactNode;
  onSubmit: () => void;
  onCancel?: () => void;
  isSubmitDisabled?: boolean;
}

function OrderActionFooter(props: FooterProps) {
  const { isSubmitDisabled } = props;
  return (
    <Container>
      <SubmitButton
        shape="rounded"
        colors="primary"
        onClick={props.onSubmit}
        disabled={isSubmitDisabled}
      >
        {props.submitButtonTitle || 'submit'}
      </SubmitButton>
      {props.actions}
    </Container>
  );
}

const SubmitButton = styled(Button)``;

const Container = styled.div`
  display: flex;
  /* justify-content: space-between; */
  gap: 15px;
  align-items: center;
  width: 100%;
  background: #f8fafc;
  border-radius: 0px 0px 6px 6px;
  padding: 10px 15px 10px 15px;
  border-top: 1px solid #edebe8;
  margin-left: 25px;
`;

export default OrderActionFooter;
