Skip to content

Commit 0811127

Browse files
committed
refactor(tables): reuse clipboard helper
1 parent 65659ee commit 0811127

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid

‎apps/sim/app/workspace/[workspaceId]/tables/[tableId]/components/table-grid/table-grid.tsx‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import type React from 'react'
44
import { Fragment, useCallback, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react'
5-
import { cn, toast, useToast } from '@sim/emcn'
5+
import { cn, toast, useToast, writeTextToClipboard } from '@sim/emcn'
66
import { Loader, TableX } from '@sim/emcn/icons'
77
import { createLogger } from '@sim/logger'
88
import type { TableCellSelection } from '@sim/realtime-protocol/table-presence'
@@ -1855,7 +1855,7 @@ export function TableGrid({
18551855
function handleCopyRowId() {
18561856
const rowId = contextMenu.row?.id
18571857
if (!rowId) return
1858-
void navigator.clipboard.writeText(rowId).catch((error) => {
1858+
void writeTextToClipboard(rowId).catch((error) => {
18591859
logger.error('Failed to copy row ID', { error })
18601860
toast.error('Failed to copy row ID')
18611861
})

0 commit comments

Comments
 (0)