mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-04-26 01:06:23 +02:00
feat: add showCloseButton prop to HITL edit panel for improved customization
- Introduced showCloseButton prop to control the visibility of the close button in the HITL edit panel. - Updated the component to conditionally render the close button based on the new prop.
This commit is contained in:
parent
b7130100aa
commit
5ea347121b
1 changed files with 4 additions and 1 deletions
|
|
@ -17,12 +17,14 @@ export function HitlEditPanelContent({
|
|||
content: initialContent,
|
||||
onSave,
|
||||
onClose,
|
||||
showCloseButton = true,
|
||||
}: {
|
||||
title: string;
|
||||
content: string;
|
||||
toolName: string;
|
||||
onSave: (title: string, content: string) => void;
|
||||
onClose?: () => void;
|
||||
showCloseButton?: boolean;
|
||||
}) {
|
||||
const [editedTitle, setEditedTitle] = useState(initialTitle);
|
||||
const markdownRef = useRef(initialContent);
|
||||
|
|
@ -49,7 +51,7 @@ export function HitlEditPanelContent({
|
|||
className="flex-1 min-w-0 bg-transparent text-sm font-semibold text-foreground outline-none placeholder:text-muted-foreground"
|
||||
aria-label="Page title"
|
||||
/>
|
||||
{onClose && (
|
||||
{onClose && showCloseButton && (
|
||||
<Button variant="ghost" size="icon" onClick={onClose} className="size-7 shrink-0">
|
||||
<XIcon className="size-4" />
|
||||
<span className="sr-only">Close panel</span>
|
||||
|
|
@ -124,6 +126,7 @@ function MobileHitlEditDrawer() {
|
|||
toolName={panelState.toolName}
|
||||
onSave={panelState.onSave}
|
||||
onClose={closePanel}
|
||||
showCloseButton={false}
|
||||
/>
|
||||
</div>
|
||||
</DrawerContent>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue