Files
supabase/apps/studio/components/interfaces/Database/Functions/CreateFunction/CreateFunctionHeader.tsx
Ali Waseem c41a5be8a5 Feature: Duplicate functions from the studio dashboard (#39821)
* added feature to duplicate functions

* updated formatting for index file

* removed unused ai assitant code

---------

Co-authored-by: Ali Waseem <awaseem@Alis-MacBook-Pro.local>
2025-10-23 15:48:53 -06:00

39 lines
1.2 KiB
TypeScript

import { X } from 'lucide-react'
import { SheetClose, SheetHeader, SheetTitle, cn } from 'ui'
interface CreateFunctionHeaderProps {
selectedFunction?: string
isDuplicating?: boolean
}
export const CreateFunctionHeader = ({
selectedFunction,
isDuplicating,
}: CreateFunctionHeaderProps) => {
return (
<SheetHeader className="py-3 flex flex-row justify-between items-center border-b-0">
<div className="flex flex-row gap-3 items-center max-w-[75%]">
<SheetClose
className={cn(
'text-muted hover:text ring-offset-background transition-opacity hover:opacity-100',
'focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2',
'disabled:pointer-events-none data-[state=open]:bg-secondary',
'transition'
)}
>
<X className="h-3 w-3" />
<span className="sr-only">Close</span>
</SheetClose>
<SheetTitle className="truncate">
{selectedFunction !== undefined
? isDuplicating
? `Duplicate function`
: `Edit '${selectedFunction}' function`
: 'Add a new function'}
</SheetTitle>
</div>
</SheetHeader>
)
}