@lobehub/ui
Version:
Lobe UI is an open-source UI component library for building AIGC web apps
1 lines • 1.62 kB
Source Map (JSON)
{"version":3,"file":"useChatListActionsBar.mjs","names":[],"sources":["../../../../src/chat/ChatList/components/useChatListActionsBar.tsx"],"sourcesContent":["'use client';\n\nimport { Copy, Edit, RotateCw, Trash } from 'lucide-react';\nimport { useMemo } from 'react';\n\nimport type { ActionIconGroupItemType } from '@/ActionIconGroup';\n\ninterface ChatListActionsBar {\n copy: ActionIconGroupItemType;\n del: ActionIconGroupItemType;\n divider: { type: 'divider' };\n edit: ActionIconGroupItemType;\n regenerate: ActionIconGroupItemType;\n}\n\nexport const useChatListActionsBar = (text?: {\n copy?: string;\n delete?: string;\n edit?: string;\n regenerate?: string;\n}): ChatListActionsBar => {\n return useMemo(\n () => ({\n copy: {\n icon: Copy,\n key: 'copy',\n label: text?.copy || 'Copy',\n },\n del: {\n icon: Trash,\n key: 'del',\n label: text?.delete || 'Delete',\n },\n divider: {\n type: 'divider',\n },\n edit: {\n icon: Edit,\n key: 'edit',\n label: text?.edit || 'Edit',\n },\n regenerate: {\n icon: RotateCw,\n key: 'regenerate',\n label: text?.regenerate || 'Regenerate',\n },\n }),\n [text],\n );\n};\n"],"mappings":";;;;AAeA,MAAa,yBAAyB,SAKZ;CACxB,OAAO,eACE;EACL,MAAM;GACJ,MAAM;GACN,KAAK;GACL,OAAO,MAAM,QAAQ;EACvB;EACA,KAAK;GACH,MAAM;GACN,KAAK;GACL,OAAO,MAAM,UAAU;EACzB;EACA,SAAS,EACP,MAAM,UACR;EACA,MAAM;GACJ,MAAM;GACN,KAAK;GACL,OAAO,MAAM,QAAQ;EACvB;EACA,YAAY;GACV,MAAM;GACN,KAAK;GACL,OAAO,MAAM,cAAc;EAC7B;CACF,IACA,CAAC,IAAI,CACP;AACF"}