UoaWDCC / uasc-web

Project with the University of Auckland Snowsports Club Website & Booking System. Established in 2023.
https://uasc.co.nz
6 stars 2 forks source link

[FRONTEND] Document all generic component props in frontend #652

Closed bcho892 closed 3 months ago

bcho892 commented 3 months ago

Is your feature request related to a problem? Please describe.

Example:

interface ITable<
  T extends TableRowObjectWithIdentifier,
  S extends TableRowOperationStyle
> {
  /**
   * List of objects that have the same type. Optional props are ok
   */
  data: T[]
  /**
   * Max items to display on a page. Defaults to 15
   */
  showPerPage?: number
  /**
   * Pass in a callback for when the last page of the table is reached (i.e go to the next offset if paginating)
   */
  onPageChange?: (isLastPage: boolean) => void
  /**
   * decides if clicking on the row options will give multiple options or a single one
   */
  operationType?: TableRowOperationStyle

  /**
   * @example // {operationName: "Delete User", (identifier: string) => {deleteUserWithUid(identifier)}}
   */
  rowOperations?: TableRowOperations<S>

  /**
   * Colour codes the rows based on grouping the first column.
   *
   * i.e for a first group of dates ranging [27/10/2002, 28/10/2002, 30/10/2002]
   *
   * 27/10/2002 - unhighlighed
   * 28/10/2002 - highlighted
   * 30/10/2002 - unhighlighed
   */
  groupSameRows?: boolean
}

BEFORE MERGING