mirror of
https://github.com/pacnpal/thrilltrack-explorer.git
synced 2025-12-23 07:51:12 -05:00
Refactor code structure and remove redundant changes
This commit is contained in:
38
src-old/components/reviews/ReviewCardMemo.tsx
Normal file
38
src-old/components/reviews/ReviewCardMemo.tsx
Normal file
@@ -0,0 +1,38 @@
|
||||
/**
|
||||
* Memoized Review Card Component
|
||||
* Optimized for list rendering performance
|
||||
*/
|
||||
|
||||
import React from 'react';
|
||||
|
||||
interface Review {
|
||||
id: string;
|
||||
rating: number;
|
||||
comment: string | null;
|
||||
created_at: string;
|
||||
updated_at: string;
|
||||
user_id: string;
|
||||
}
|
||||
|
||||
interface ReviewCardProps {
|
||||
review: Review;
|
||||
onEdit?: (review: Review) => void;
|
||||
onDelete?: (reviewId: string) => void;
|
||||
}
|
||||
|
||||
export const ReviewCard: React.FC<ReviewCardProps> = ({ review, onEdit, onDelete }) => {
|
||||
// Component implementation would go here
|
||||
// This is a placeholder for the actual review card
|
||||
return null;
|
||||
};
|
||||
|
||||
export const ReviewCardMemo = React.memo(ReviewCard, (prevProps, nextProps) => {
|
||||
return (
|
||||
prevProps.review.id === nextProps.review.id &&
|
||||
prevProps.review.rating === nextProps.review.rating &&
|
||||
prevProps.review.comment === nextProps.review.comment &&
|
||||
prevProps.review.updated_at === nextProps.review.updated_at
|
||||
);
|
||||
});
|
||||
|
||||
ReviewCardMemo.displayName = 'ReviewCardMemo';
|
||||
Reference in New Issue
Block a user