Skip to content

Commit 0fca38e

Browse files
committed
fix comments
1 parent 8e174a5 commit 0fca38e

File tree

3 files changed

+23
-18
lines changed

3 files changed

+23
-18
lines changed

peerprep-fe/src/app/(main)/components/Filter/FilterBadge.tsx

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
import { Badge } from "@/components/ui/badge";
22
import { X } from "lucide-react";
3-
4-
interface FilterBadgeProps {
5-
filterType: "difficulty" | "status" | "topics";
6-
value: string;
7-
onRemove: (filterType: string, value: string) => void;
8-
}
3+
import { FilterBadgeProps } from "@/types/types";
4+
import { cn } from "@/lib/utils";
95

106
export function FilterBadge({ filterType, value, onRemove }: FilterBadgeProps) {
117
const getBadgeColor = () => {
@@ -29,10 +25,12 @@ export function FilterBadge({ filterType, value, onRemove }: FilterBadgeProps) {
2925
}
3026
};
3127

32-
const badgeColor = getBadgeColor();
33-
3428
return (
35-
<Badge variant="secondary" hover={false} className={`pr-1 ${badgeColor}`}>
29+
<Badge
30+
variant="secondary"
31+
hover={false}
32+
className={cn("pr-1", getBadgeColor())}
33+
>
3634
{`${filterType}: ${value}`}
3735
<button
3836
onClick={() => onRemove(filterType, value)}

peerprep-fe/src/app/(main)/components/Filter/FilterSelect.tsx

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,7 @@ import {
44
SelectItem,
55
SelectTrigger,
66
} from "@/components/ui/select";
7-
8-
interface FilterSelectProps {
9-
placeholder: string;
10-
options: { value: string; label: string }[];
11-
onChange: (value: string) => void;
12-
value: string | string[];
13-
isMulti?: boolean;
14-
}
7+
import { FilterSelectProps } from "@/types/types";
158

169
export function FilterSelect({
1710
placeholder,

peerprep-fe/src/types/types.ts

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,18 @@ interface ProblemDialogData {
1717
description: string;
1818
}
1919

20-
export type { Problem, ProblemDialogData };
20+
interface FilterBadgeProps {
21+
filterType: "difficulty" | "status" | "topics";
22+
value: string;
23+
onRemove: (filterType: string, value: string) => void;
24+
}
25+
26+
interface FilterSelectProps {
27+
placeholder: string;
28+
options: { value: string; label: string }[];
29+
onChange: (value: string) => void;
30+
value: string | string[];
31+
isMulti?: boolean;
32+
}
33+
34+
export type { Problem, ProblemDialogData, FilterBadgeProps, FilterSelectProps };

0 commit comments

Comments
 (0)