forked from jordanlambrecht/tracker-tracker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathSectionToggle.tsx
More file actions
32 lines (28 loc) · 821 Bytes
/
Copy pathSectionToggle.tsx
File metadata and controls
32 lines (28 loc) · 821 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
// src/components/ui/SectionToggle.tsx
import clsx from "clsx"
import type { ReactNode } from "react"
import { ChevronToggle } from "@/components/ui/ChevronToggle"
interface SectionToggleProps {
label: ReactNode
expanded: boolean
onToggle: () => void
className?: string
}
function SectionToggle({ label, expanded, onToggle, className }: SectionToggleProps) {
return (
<button
type="button"
onClick={onToggle}
className={clsx(
"flex items-center gap-2 text-xs font-sans font-medium text-tertiary uppercase tracking-wider",
"hover:text-secondary transition-colors duration-150 cursor-pointer w-fit",
className
)}
>
<ChevronToggle expanded={expanded} />
{label}
</button>
)
}
export type { SectionToggleProps }
export { SectionToggle }