<template>
  <ul
    class="record_actions"
    v-if="!options.onlyButton"
    :class="{ 'sticky-form-buttons': isStickyForm }"
  >
    <li v-if="isStickyForm" class="cancel">
      <slot name="before" />
    </li>
    <li>
      <slot name="action" />
    </li>
    <li v-if="isStickyForm">
      <slot name="after" />
    </li>
  </ul>
  <slot v-else name="action" />
</template>

<script>
export default {
  name: "ActionButtons",
  props: ["options", "defaultz"],
  computed: {
    isStickyForm() {
      return typeof this.options.stickyActions !== "undefined"
        ? this.options.stickyActions
        : this.defaultz.stickyActions;
    },
  },
};
</script>
