Skip to content

Commit

Permalink
Merge pull request #431 from Kernel360/feat-add-badge
Browse files Browse the repository at this point in the history
feat: 서치 컴포넌트에 배지 추가
  • Loading branch information
smosco authored Dec 18, 2024
2 parents 74affd1 + 3b55390 commit 57dd30d
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions src/app/(default)/search/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Suspense } from 'react';

import { useSearchParams } from 'next/navigation';

import { Clock, Eye } from 'lucide-react';
import { BookOpen, Clock, Eye, Headphones } from 'lucide-react';

import { useFetchSearchResults } from '@/api/hooks/useSearch';
import EmptyAlert from '@/components/common/EmptyAlert';
Expand Down Expand Up @@ -80,7 +80,21 @@ function SearchResultsList() {
)
}
coverImageUrl={result.thumbnailUrl}
leftBadge={<Badge>{result.category}</Badge>}
leftBadge={
<div className="flex gap-1">
<Badge className="">{result.category}</Badge>

{result.contentType !== 'READING' ? (
<div className="flex justify-center items-center bg-gradient-to-l from-red-500 to-orange-500 rounded-sm shadow-sm">
<Headphones className="p-1 h-6 w-6 text-white" />
</div>
) : (
<div className="flex justify-center items-center bg-gradient-to-l from-blue-500 to-sky-500 rounded-sm shadow-sm ">
<BookOpen className="p-1 h-6 w-6 text-white" />
</div>
)}
</div>
}
rightBadge={
<div className="flex items-center gap-1 text-gray-400">
<Eye className="w-4 h-4" />
Expand Down

0 comments on commit 57dd30d

Please sign in to comment.