Skip to content

Root: ui|v2.5|src|components|Performers: PerformerList.tsx

Serechops edited this page Apr 10, 2024 · 1 revision

PerformerList.tsx

This file contains a React functional component PerformerList used to display a list of performers with various functionalities. Here's an overview of its structure and functionalities:

  1. Imports: The file imports necessary modules and components from lodash, React, React Router, and custom components.

  2. Helper Functions:

    • FormatHeight: Formats the height of a performer, converting it from centimeters to both metric and imperial units.
    • FormatAge: Formats the age of a performer based on their birthdate and optionally death date.
    • FormatWeight: Formats the weight of a performer, converting it from kilograms to both metric and imperial units.
    • FormatCircumcised: Formats the circumcision status of a performer.
    • FormatPenisLength: Formats the length of a performer's penis, converting it from centimeters to both metric and imperial units.
  3. Component Props:

    • filterHook: A function to customize the filter applied to the list of performers.
    • persistState: A parameter to determine the persistence level of the filter state.
    • alterQuery: A boolean indicating whether to alter the query.
    • extraCriteria: Extra criteria for filtering performer information.
  4. Rendering:

    • The component renders an PerformerItemList component which handles the fetching and rendering of the list of performers based on the provided filter criteria.
    • It also renders dialogs for editing and deleting performers.
  5. Functions:

    • openRandom: Opens a random performer's page.
    • onExport: Opens the export dialog for selected performers.
    • onExportAll: Opens the export dialog for all performers.
    • renderContent: Renders the list of performers based on the selected display mode (Grid, List, Tagger).
    • renderEditDialog: Renders the dialog for editing performers.
    • renderDeleteDialog: Renders the dialog for deleting performers.

Example Usage:

import PerformerList from "./PerformerList";

// Inside a React component
<PerformerList />;

Explanation:

This will render a list of performers with various functions.

Clone this wiki locally