Skip to content

Commit

Permalink
Allow passing props to QuestionsTypeBadge
Browse files Browse the repository at this point in the history
  • Loading branch information
elboletaire committed Aug 22, 2024
1 parent ff76e63 commit 44ea2b9
Showing 1 changed file with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
import { Tooltip } from '@chakra-ui/react'
import { chakra, useMultiStyleConfig } from '@chakra-ui/system'
import { chakra, ChakraProps, useMultiStyleConfig } from '@chakra-ui/system'
import { useElection } from '@vocdoni/react-providers'
import { ElectionResultsTypeNames, PublishedElection } from '@vocdoni/sdk'
import type { HTMLAttributes } from 'react'

export const QuestionsTypeBadge = () => {
type QuestionsTypeBadgeProps = ChakraProps & HTMLAttributes<HTMLDivElement>

export const QuestionsTypeBadge = (props: QuestionsTypeBadgeProps) => {
const styles = useMultiStyleConfig('QuestionsTypeBadge')
const { election, localize } = useElection()

Expand Down Expand Up @@ -32,8 +35,8 @@ export const QuestionsTypeBadge = () => {
}

return (
<chakra.div __css={styles.box}>
<Tooltip label={tooltip} hasArrow sx={styles.tooltip} placement='auto'>
<chakra.div __css={styles.box} {...props}>
<Tooltip label={tooltip} hasArrow placement='auto' sx={styles.tooltip}>
<chakra.label __css={styles.title}>{title}</chakra.label>
</Tooltip>
</chakra.div>
Expand Down

0 comments on commit 44ea2b9

Please sign in to comment.