refactor: consolidate editable title components into a unified UI module, removing redundant files and updating imports
This commit is contained in:
29
src/components/ui/EditableSessionTitle.tsx
Normal file
29
src/components/ui/EditableSessionTitle.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
'use client';
|
||||
|
||||
import { EditableTitle } from './EditableTitle';
|
||||
import { updateSessionTitle } from '@/actions/session';
|
||||
|
||||
interface EditableSessionTitleProps {
|
||||
sessionId: string;
|
||||
initialTitle: string;
|
||||
isOwner: boolean;
|
||||
}
|
||||
|
||||
export function EditableSessionTitle({
|
||||
sessionId,
|
||||
initialTitle,
|
||||
isOwner,
|
||||
}: EditableSessionTitleProps) {
|
||||
return (
|
||||
<EditableTitle
|
||||
sessionId={sessionId}
|
||||
initialTitle={initialTitle}
|
||||
isOwner={isOwner}
|
||||
onUpdate={async (id, title) => {
|
||||
const result = await updateSessionTitle(id, title);
|
||||
return result;
|
||||
}}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user