Skip to content

Commit

Permalink
add comments to props
Browse files Browse the repository at this point in the history
  • Loading branch information
charliepark committed Sep 5, 2024
1 parent 0e99ec3 commit 9b81b1e
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions app/table/columns/action-col.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,15 @@ export const getActionsCol = <TData extends Record<string, unknown>>(
}
}

type RowActionsProps = { id?: string | null; copyIdLabel?: string; actions?: MenuAction[] }
type RowActionsProps = {
/** If id is provided, a `Copy ID` menu item will be automatically included. */
id?: string | null
/** Use copyIdLabel to override the default label. */
copyIdLabel?: string
actions?: MenuAction[]
}

export const RowActions = ({ id, copyIdLabel, actions }: RowActionsProps) => {
export const RowActions = ({ id, copyIdLabel = 'Copy ID', actions }: RowActionsProps) => {
return (
<DropdownMenu.Root>
{/* TODO: This name should not suck; future us, make it so! */}
Expand All @@ -78,7 +84,7 @@ export const RowActions = ({ id, copyIdLabel, actions }: RowActionsProps) => {
window.navigator.clipboard.writeText(id)
}}
>
{copyIdLabel || 'Copy ID'}
{copyIdLabel}
</DropdownMenu.Item>
)}
{actions?.map((action) => {
Expand Down

0 comments on commit 9b81b1e

Please sign in to comment.