Skip to content

Commit

Permalink
feat: add reusable IconButton component
Browse files Browse the repository at this point in the history
  • Loading branch information
olavis committed Mar 14, 2023
1 parent 1ee3eff commit f933e30
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions web/src/common/components/IconButton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { Button, Icon, Tooltip } from '@equinor/eds-core-react'
import { IconData } from '@equinor/eds-icons'

interface IconButtonProps {
title: string
icon: IconData
onClick: () => Promise<void>
}

const IconButton = ({ title, icon, onClick }: IconButtonProps) => {
return (
<Tooltip title={title}>
<Button variant="ghost_icon" onClick={onClick}>
<Icon data={icon} size={24} title={title} />
</Button>
</Tooltip>
)
}

export default IconButton

0 comments on commit f933e30

Please sign in to comment.