forked from CopilotKit/CopilotKit
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathframe.tsx
More file actions
34 lines (33 loc) · 849 Bytes
/
Copy pathframe.tsx
File metadata and controls
34 lines (33 loc) · 849 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 React from "react";
export function Frame({
children,
className,
description,
}: {
children: React.ReactNode;
className?: string;
description?: string;
}) {
return (
<>
<div
className={`flex space-x-4 w-full mx-auto justify-center ${className}`}
>
{React.Children.map(children, (child) => {
if (React.isValidElement(child)) {
const element = child as React.ReactElement<any>;
return React.cloneElement(element, {
className: `border border-foreground-muted rounded-md shadow-lg ${
element.props.className || ""
}`,
});
}
return child;
})}
</div>
{description && (
<p className="text-sm text-neutral-500 text-center">{description}</p>
)}
</>
);
}