99 TrashIcon ,
1010 EyeIcon ,
1111 EyeSlashIcon ,
12+ ClipboardIcon ,
13+ CheckIcon ,
1214} from '@heroicons/react/24/outline' ;
1315import toast from 'react-hot-toast' ;
1416
@@ -20,6 +22,18 @@ export function AdminBoardsPage() {
2022 const [ editingBoard , setEditingBoard ] = useState < { id : string ; name : string ; isPrivate : boolean } | null > ( null ) ;
2123 const [ newBoard , setNewBoard ] = useState < CreateBoardData > ( { name : '' , isPrivate : false } ) ;
2224 const [ isSubmitting , setIsSubmitting ] = useState ( false ) ;
25+ const [ copiedBoardId , setCopiedBoardId ] = useState < string | null > ( null ) ;
26+
27+ const handleCopyBoardId = async ( boardId : string ) => {
28+ try {
29+ await navigator . clipboard . writeText ( boardId ) ;
30+ setCopiedBoardId ( boardId ) ;
31+ toast . success ( 'Board ID copied to clipboard!' ) ;
32+ setTimeout ( ( ) => setCopiedBoardId ( null ) , 2000 ) ;
33+ } catch ( err ) {
34+ toast . error ( 'Failed to copy Board ID' ) ;
35+ }
36+ } ;
2337
2438 useEffect ( ( ) => {
2539 fetchBoards ( ) ;
@@ -181,6 +195,18 @@ export function AdminBoardsPage() {
181195 </ td >
182196 < td className = "of-px-6 of-py-4 of-whitespace-nowrap of-text-right" >
183197 < div className = "of-flex of-items-center of-justify-end of-gap-2" >
198+ < Button
199+ size = "sm"
200+ variant = "ghost"
201+ onClick = { ( ) => handleCopyBoardId ( board . id ) }
202+ title = "Copy Board ID"
203+ >
204+ { copiedBoardId === board . id ? (
205+ < CheckIcon className = "of-w-4 of-h-4 of-text-green-600" />
206+ ) : (
207+ < ClipboardIcon className = "of-w-4 of-h-4" />
208+ ) }
209+ </ Button >
184210 < Button
185211 size = "sm"
186212 variant = "ghost"
@@ -189,6 +215,7 @@ export function AdminBoardsPage() {
189215 name : board . name ,
190216 isPrivate : board . isPrivate ,
191217 } ) }
218+ title = "Edit Board"
192219 >
193220 < PencilIcon className = "of-w-4 of-h-4" />
194221 </ Button >
@@ -197,6 +224,7 @@ export function AdminBoardsPage() {
197224 variant = "ghost"
198225 onClick = { ( ) => handleDelete ( board . id , board . name ) }
199226 className = "of-text-red-600 hover:of-text-red-700"
227+ title = "Delete Board"
200228 >
201229 < TrashIcon className = "of-w-4 of-h-4" />
202230 </ Button >
0 commit comments