-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💬 Display category descriptions (#477)
- Loading branch information
1 parent
ddccc2b
commit 86f08b5
Showing
3 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,23 @@ | ||
import { type CategoryColor } from "@/types/CategoryColor"; | ||
import { Category } from "@/types/Category"; | ||
|
||
import { Badge } from "../badge"; | ||
import { Tooltip, TooltipContent, TooltipTrigger } from "../tooltip"; | ||
import { getCategoryIcon } from "./getCategoryIcon"; | ||
|
||
interface Category { | ||
color: CategoryColor; | ||
name: string; | ||
} | ||
|
||
interface CategoryBadgeProps { | ||
category: Category; | ||
category: Omit<Category, "id">; | ||
} | ||
|
||
export function CategoryBadge({ category }: CategoryBadgeProps) { | ||
return ( | ||
<Badge variant={category.color}> | ||
{getCategoryIcon(category.color)} | ||
{category.name} | ||
</Badge> | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<Badge variant={category.color}> | ||
{getCategoryIcon(category.color)} | ||
{category.name} | ||
</Badge> | ||
</TooltipTrigger> | ||
<TooltipContent>{category.description}</TooltipContent> | ||
</Tooltip> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters