Skip to content

Commit

Permalink
Re-arrange CardMedia props
Browse files Browse the repository at this point in the history
  • Loading branch information
Youakeem committed Sep 16, 2024
1 parent 5aa29e3 commit 91519e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/ui/src/components/Card/Card.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

import { Slot } from '@radix-ui/react-slot'
import { type RecipeVariants } from '@vanilla-extract/recipes'
import clsx from 'clsx'
Expand All @@ -19,9 +18,9 @@ function CardHeader({ className, children }: PropsWithChildren<HeaderProps>) {
return <header className={clsx(cardHeader, className)}>{children}</header>
}

type MediaProps = ComponentProps<typeof Slot>
type MediaProps = PropsWithChildren<ComponentProps<typeof Slot>>

function CardMedia({ children }: PropsWithChildren<MediaProps>) {
function CardMedia({ children }: MediaProps) {
// Slot ensures only one element is passed as children
return <Slot>{children}</Slot>
}
Expand Down

0 comments on commit 91519e1

Please sign in to comment.