Files
web/packages/design-system/lib/components/TripAdvisorChip/index.tsx
Joakim Jäderberg 80c3327419 Merged in fix/linting (pull request #2708)
Fix/linting

* fix import issues and add lint check no-extraneous-dependencies
* fix use type HotelType instead of string

Approved-by: Anton Gunnarsson
2025-08-27 09:22:37 +00:00

47 lines
1.1 KiB
TypeScript

import { cva, type VariantProps } from 'class-variance-authority'
import TripadvisorIcon from '../Icons/Customised/Socials/Tripadvisor'
import styles from './tripAdvisorChip.module.css'
import { Typography } from '../Typography'
const container = cva(styles.container, {
variants: {
variant: {
default: null,
small: styles.containerSmall,
},
},
defaultVariants: {
variant: 'default',
},
})
const chip = cva(styles.tripAdvisor, {
variants: {
variant: {
default: null,
small: styles.tripAdvisorSmall,
},
},
defaultVariants: {
variant: 'default',
},
})
type TripAdvisorProps = {
rating: number
} & VariantProps<typeof container>
export function TripAdvisorChip({ rating, variant }: TripAdvisorProps) {
return (
// Wrapping the chip in a transparent container with some padding to increase the touch target
<div className={container({ variant })}>
<div className={chip({ variant })}>
<TripadvisorIcon size={16} color="Icon/Interactive/Default" />
<Typography variant="Tag/sm">
<p>{rating}</p>
</Typography>
</div>
</div>
)
}