Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaid-maker committed Jan 18, 2024
1 parent 30caa00 commit c69cf7c
Showing 1 changed file with 24 additions and 21 deletions.
45 changes: 24 additions & 21 deletions app/(browse)/search/_components/results-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { Skeleton } from "@/components/ui/skeleton";
import { VerifiedMark } from "@/components/verified-mark";
import { User } from "@prisma/client";
import { formatDistanceToNow } from "date-fns";
import Link from "next/link";
import React from "react";

interface ResultsCardProps {
Expand All @@ -18,30 +19,32 @@ interface ResultsCardProps {

export const ResultsCard = ({ data }: ResultsCardProps) => {
return (
<div className="w-full flex gap-x-4">
<div className="relative h-[9rem] w-[16rem]">
<Thumbnail
src={data.thumbnailUrl}
fallback={data.user.imageUrl}
isLive={data.isLive}
username={data.user.username}
/>
</div>
<div className="space-y-1">
<div className="flex items-center gap-x-2">
<p className="font-bold text-lg cursor-pointer hover:text-blue-500">
{data.user.username}
<Link href={`/${data.user.username}`}>
<div className="w-full flex gap-x-4">
<div className="relative h-[9rem] w-[16rem]">
<Thumbnail
src={data.thumbnailUrl}
fallback={data.user.imageUrl}
isLive={data.isLive}
username={data.user.username}
/>
</div>
<div className="space-y-1">
<div className="flex items-center gap-x-2">
<p className="font-bold text-lg cursor-pointer hover:text-blue-500">
{data.user.username}
</p>
<VerifiedMark />
</div>
<p className="text-sm text-muted-foreground">{data.name}</p>
<p className="text-sm text-muted-foreground">
{formatDistanceToNow(new Date(data.updatedAt), {
addSuffix: true,
})}
</p>
<VerifiedMark />
</div>
<p className="text-sm text-muted-foreground">{data.name}</p>
<p className="text-sm text-muted-foreground">
{formatDistanceToNow(new Date(data.updatedAt), {
addSuffix: true,
})}
</p>
</div>
</div>
</Link>
);
};

Expand Down

0 comments on commit c69cf7c

Please sign in to comment.