mirror of
https://github.com/linsa-io/linsa.git
synced 2026-01-12 12:20:23 +01:00
tasks sidebar ui
This commit is contained in:
@@ -61,12 +61,14 @@ export const TaskSection: React.FC<{ pathname: string }> = ({ pathname }) => {
|
|||||||
<TaskSectionHeader title="Tasks" href="/tasks" count={taskCount} isActive={pathname === "/tasks"} />
|
<TaskSectionHeader title="Tasks" href="/tasks" count={taskCount} isActive={pathname === "/tasks"} />
|
||||||
<TaskSectionHeader
|
<TaskSectionHeader
|
||||||
title="Today"
|
title="Today"
|
||||||
|
iconName="BookOpenCheck"
|
||||||
href="/tasks/today"
|
href="/tasks/today"
|
||||||
count={todayTasks.length}
|
count={todayTasks.length}
|
||||||
isActive={pathname === "/tasks/today"}
|
isActive={pathname === "/tasks/today"}
|
||||||
/>
|
/>
|
||||||
<TaskSectionHeader
|
<TaskSectionHeader
|
||||||
title="Upcoming"
|
title="Upcoming"
|
||||||
|
iconName="History"
|
||||||
href="/tasks/upcoming"
|
href="/tasks/upcoming"
|
||||||
count={upcomingTasks.length}
|
count={upcomingTasks.length}
|
||||||
isActive={pathname === "/tasks/upcoming"}
|
isActive={pathname === "/tasks/upcoming"}
|
||||||
@@ -80,9 +82,10 @@ interface TaskSectionHeaderProps {
|
|||||||
href: string
|
href: string
|
||||||
count: number
|
count: number
|
||||||
isActive: boolean
|
isActive: boolean
|
||||||
|
iconName?: "BookOpenCheck" | "History"
|
||||||
}
|
}
|
||||||
|
|
||||||
const TaskSectionHeader: React.FC<TaskSectionHeaderProps> = ({ title, href, count, isActive }) => (
|
const TaskSectionHeader: React.FC<TaskSectionHeaderProps> = ({ title, href, count, isActive, iconName }) => (
|
||||||
<div
|
<div
|
||||||
className={cn(
|
className={cn(
|
||||||
"flex min-h-[30px] items-center gap-px rounded-md",
|
"flex min-h-[30px] items-center gap-px rounded-md",
|
||||||
@@ -93,7 +96,9 @@ const TaskSectionHeader: React.FC<TaskSectionHeaderProps> = ({ title, href, coun
|
|||||||
href={href}
|
href={href}
|
||||||
className="flex flex-1 items-center justify-start rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-0"
|
className="flex flex-1 items-center justify-start rounded-md px-2 py-1 focus-visible:outline-none focus-visible:ring-0"
|
||||||
>
|
>
|
||||||
<p className="text-xs">
|
{iconName && <LaIcon className="size-13 shrink-0 pr-2" name={iconName} />}
|
||||||
|
|
||||||
|
<p className="text-sm">
|
||||||
{title}
|
{title}
|
||||||
{count > 0 && <span className="text-muted-foreground ml-1">{count}</span>}
|
{count > 0 && <span className="text-muted-foreground ml-1">{count}</span>}
|
||||||
</p>
|
</p>
|
||||||
|
|||||||
Reference in New Issue
Block a user