Skip to content

Commit

Permalink
make delete work
Browse files Browse the repository at this point in the history
  • Loading branch information
mariusandra committed Jul 16, 2024
1 parent b9ecca1 commit c1285c1
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions frontend/src/scenes/frame/panels/Diagram/CodeArg.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface CodeArgProps {
onDelete?: () => void
}

export function CodeArg({ codeArg, onChange }: CodeArgProps): JSX.Element {
export function CodeArg({ codeArg, onChange, onDelete }: CodeArgProps): JSX.Element {
const [name, setName] = useState(codeArg.name ?? '')
const [type, setType] = useState(codeArg.type ?? 'string')

Expand Down Expand Up @@ -66,9 +66,11 @@ export function CodeArg({ codeArg, onChange }: CodeArgProps): JSX.Element {
>
Update
</Button>
<Button color="tertiary" size="small" onClick={() => onChange?.({ name, type })}>
Delete
</Button>
{onDelete ? (
<Button color="tertiary" size="small" onClick={() => onDelete?.()}>
Delete
</Button>
) : null}
</div>
</div>
}
Expand Down

0 comments on commit c1285c1

Please sign in to comment.