forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom-accordion.tsx
More file actions
34 lines (31 loc) · 963 Bytes
/
Copy pathcustom-accordion.tsx
File metadata and controls
34 lines (31 loc) · 963 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
33
34
import { Accordion } from "fumadocs-ui/components/accordion";
interface CustomAccordionProps {
title: string;
icon?: React.ReactNode;
children: React.ReactNode;
}
export function CustomAccordion({
title,
children,
icon,
}: CustomAccordionProps) {
const value = title.toLowerCase().replace(/\s+/g, "-");
return (
<Accordion
value={value}
title={
<div className="flex items-center gap-4">
<div className="opacity-60 group-hover:opacity-100 group-data-[state=open]:opacity-100 transition-opacity duration-300">
{icon}
</div>
<div className="text-base font-medium! text-[#010507] dark:text-white">
{title}
</div>
</div>
}
className="group bg-[#FFFFFF80] border-none! accordion-icon-right dark:bg-[#01050780] rounded-lg hover:bg-[#FFFFFF] dark:hover:bg-[#FFFFFF0D] transition-all duration-300"
>
{children}
</Accordion>
);
}