Source

admin-bro/src/frontend/components/actions/action.props.ts

import { Dispatch, SetStateAction } from 'react'
import { ActionJSON, RecordJSON, ResourceJSON } from '../../interfaces'

/**
 * Props which are passed to all action components
 * @alias ActionProps
 * @memberof BaseActionComponent
 */
export type ActionProps = {
  /**
   * Action object describing the action
   */
  action: ActionJSON;
  /**
   * Object of type: {@link ResourceJSON}
   */
  resource: ResourceJSON;
  /**
   * Selected record. Passed for actions with "record" actionType
   */
  record?: RecordJSON;

  /**
   * Selected records. Passed for actions with "bulk" actionType
   */
  records?: Array<RecordJSON>;

  /**
   * Sets tag in a header of an action. It is a function taking tag as an argument
   */
  setTag?: Dispatch<SetStateAction<string>>;
}
SoftwareBrothers

Proudly built and maintained by SoftwareBrothers

Software House with a passion for both JavaScript and TypeScript.

See what we do See what we believe in

Proudly built and maintained by

SoftwareBrothers