Skip to content

CatalogueContent.tsx refactor #262

Description

@Abh1noob

Lines 390-425 -> Avoid such deep terenary nesting

Refactor component rendering by using early returns for loading, error, and empty states instead of nested ternaries. This will simplify JSX, improve readability, and make the render flow easier to follow.

Like:

if (loading) {
  return <Loader />;
}

if (error) {
  return (
    <Error />
  );
}

return (
    <Card
      key={paper._id}
      paper={paper}
      onSelect={handleSelectPaper}
      isSelected={selectedPapers.some((p) => p._id === paper._id)}
    />
);

something like this (its just a pseudocode)

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions