/*!
 * Copyright (c) 2023-present, Okta, Inc. and/or its affiliates. All rights reserved.
 * The Okta software accompanied by this notice is provided pursuant to the Apache License, Version 2.0 (the "License.")
 *
 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *
 * See the License for the specific language governing permissions and limitations under the License.
 */

import styled from "@emotion/styled";
import { memo } from "react";
import { Button } from "../Buttons/Button.js";
import { useTranslation } from "../i18n.generated/i18n.js";
import { useOdysseyDesignTokens } from "../OdysseyDesignTokensContext.js";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
const ActionContainer = styled.div(({
  odysseyDesignTokens
}) => ({
  display: "flex",
  justifyContent: "flex-end",
  paddingInline: odysseyDesignTokens.Spacing4,
  paddingBlockEnd: odysseyDesignTokens.Spacing4
}));
const DateFieldActionBar = ({
  actions,
  onAccept,
  onCancel
}) => {
  const {
    t
  } = useTranslation();
  const odysseyDesignTokens = useOdysseyDesignTokens();
  if (actions && actions.length > 0) {
    return _jsxs(ActionContainer, {
      odysseyDesignTokens: odysseyDesignTokens,
      children: [_jsx(Button, {
        label: t("picker.labels.action.cancel"),
        onClick: onCancel,
        variant: "floating"
      }), _jsx(Button, {
        label: t("picker.labels.action.apply"),
        onClick: onAccept,
        variant: "primary"
      })]
    });
  }
  return null;
};
const MemoizedDateFieldActionBar = memo(DateFieldActionBar);
MemoizedDateFieldActionBar.displayName = "DateFieldActionBar";
export { MemoizedDateFieldActionBar as DateFieldActionBar };
//# sourceMappingURL=DateFieldActionBar.js.map