-
-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Refactored React components folder structure
- Loading branch information
Showing
12 changed files
with
233 additions
and
214 deletions.
There are no files selected for viewing
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
import { cn } from "@/lib/utils"; | ||
import { | ||
Tooltip, | ||
TooltipContent, | ||
TooltipTrigger, | ||
} from "@/components/ui/tooltip"; | ||
|
||
type JobStatsTileProps = { | ||
value: number; | ||
className: string; | ||
onClick: () => void; | ||
active: boolean; | ||
tooltip: string; | ||
}; | ||
|
||
export function JobStatsTile({ | ||
value, | ||
className, | ||
onClick, | ||
active, | ||
tooltip, | ||
}: JobStatsTileProps) { | ||
return ( | ||
<Tooltip> | ||
<TooltipTrigger> | ||
<li | ||
onClick={onClick} | ||
className={cn( | ||
"flex flex-col items-center justify-center text-xs w-10 h-10 rounded-lg", | ||
active && "bg-muted text-primary", | ||
)} | ||
> | ||
{value} | ||
<div className={cn("w-2 h-2 rounded-full", className)} /> | ||
</li> | ||
</TooltipTrigger> | ||
<TooltipContent> | ||
<p>{tooltip}</p> | ||
</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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { Link, useLocation } from "react-router-dom"; | ||
import { cn } from "@/lib/utils"; | ||
import type { ReactNode } from "react"; | ||
|
||
type SidebarNavLinkProps = { | ||
children: ReactNode; | ||
to: string; | ||
}; | ||
|
||
export function SidebarNavLink({ children, to }: SidebarNavLinkProps) { | ||
const { pathname } = useLocation(); | ||
|
||
return ( | ||
<Link | ||
to={to} | ||
className={cn( | ||
"flex items-center gap-3 rounded-lg px-3 py-2 text-muted-foreground transition-all hover:text-primary", | ||
|
||
pathname.startsWith(to) && "bg-muted text-primary", | ||
)} | ||
> | ||
{children} | ||
</Link> | ||
); | ||
} |
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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { cn } from "@/lib/utils"; | ||
import type { ReactNode } from "react"; | ||
|
||
type SidebarTitleProps = { | ||
children: ReactNode; | ||
className?: string; | ||
}; | ||
|
||
export function SidebarTitle({ children, className }: SidebarTitleProps) { | ||
return ( | ||
<div className={cn("text-xs px-3 ml-4 font-medium", className)}> | ||
{children} | ||
</div> | ||
); | ||
} |
Oops, something went wrong.