Skip to content

Commit ce33385

Browse files
committed
refactor(code-review): simplify empty state message
Generated-By: PostHog Code Task-Id: 199c1147-fca6-415b-9ea1-00a45d9b7267
1 parent 9fa1c49 commit ce33385

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

packages/ui/src/features/code-review/components/ReviewShell.tsx

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,17 @@ const SIDEBAR_MIN_WIDTH = 200;
4545
const SIDEBAR_MAX_WIDTH = 500;
4646
const SIDEBAR_DEFAULT_WIDTH = 280;
4747

48+
function getEmptyReviewMessage(commentFilter: CommentFileFilter): string {
49+
switch (commentFilter) {
50+
case "commented":
51+
return "No files with comments";
52+
case "unresolved":
53+
return "No files with unresolved comments";
54+
case "none":
55+
return "No file changes to review";
56+
}
57+
}
58+
4859
function ExpandedSidebar({ task }: { task: Task }) {
4960
const reviewHost = useService<ReviewHost>(REVIEW_HOST);
5061
const [width, setWidth] = useState(SIDEBAR_DEFAULT_WIDTH);
@@ -371,11 +382,7 @@ export function ReviewShell({
371382
reviewContent = (
372383
<Flex align="center" justify="center" className="min-h-0 flex-1">
373384
<Text color="gray" className="text-sm">
374-
{activeCommentFilter === "commented"
375-
? "No files with comments"
376-
: activeCommentFilter === "unresolved"
377-
? "No files with unresolved comments"
378-
: "No file changes to review"}
385+
{getEmptyReviewMessage(activeCommentFilter)}
379386
</Text>
380387
</Flex>
381388
);

0 commit comments

Comments
 (0)