diff --git a/components/Card.tsx b/components/Card.tsx index 0d7fc532..5c7a68fc 100644 --- a/components/Card.tsx +++ b/components/Card.tsx @@ -1,5 +1,5 @@ import {createStyles} from '@mantine/core' -import {cleanIframe} from '~/lib/helpers' +import {Post} from '~/lib/types' const useStyles = createStyles((theme) => ({ card: { @@ -19,18 +19,19 @@ const useStyles = createStyles((theme) => ({ /** * Card component. */ -export default function Card(props) { +export default function Card(props: Post) { const {classes} = useStyles() return (
{(() => { - switch (props?.type) { + switch (props?.post_hint) { case 'image': return ( - + {props?.title} + poster={props?.images?.url} + preload="metadata" + width={props?.media?.reddit_video?.width} + > + + ) case 'rich:video': - return ( - + + + ) : ( +
+ > +