Open History to see the last commit
1import type { ReactNode } from "react";
2
3import { cn } from "../lib/utils";
4import { THREAD_DETAILS_PANEL_LABEL_CLASS } from "./chat/threadDetailsPanelStyles";
5
6export function ComposerContextLabel({
7 children,
8 displayMode = "toolbar",
9}: {
10 children: ReactNode;
11 displayMode?: "toolbar" | "panel";
12}) {
13 return (
14 <span
15 data-composer-label
16 className={cn(
17 "min-w-0",
18 displayMode === "panel"
19 ? "flex-1 overflow-x-clip overflow-y-visible text-left"
20 : "max-w-[240px] group-data-[compact]/composer-context:max-w-0",
21 )}
22 >
23 <span
24 data-composer-label-motion
25 className={cn(
26 "block w-full min-w-0 truncate",
27 THREAD_DETAILS_PANEL_LABEL_CLASS,
28 displayMode === "toolbar" &&
29 "max-w-[240px] transition-opacity duration-180 ease-drawer group-data-[compact]/composer-context:opacity-0 motion-reduce:transition-none",
30 )}
31 >
32 {children}
33 </span>
34 </span>
35 );
36}