Skip to content

Commit

Permalink
refactor: separate UserItem and NoResult component
Browse files Browse the repository at this point in the history
  • Loading branch information
GBAJS754 committed Apr 1, 2024
1 parent 3e442df commit 1ddd53e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
File renamed without changes.
8 changes: 5 additions & 3 deletions src/pages/Search/SearchResult/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import Article from '@/components/Article';
import { Post } from '@/type/Post';
import { User } from '@/type/User';
import NoResult from './NoResult';
import UserItem from './UserItem';
import NoResult from '../NoResult';
import UserItem from '../UserItem';

type SearchResultProps = {
searchResList: (Post | User)[] | undefined;
Expand All @@ -21,7 +21,9 @@ const SearchResult = ({ searchResList, type }: SearchResultProps) => {
{filteredSearchResList && (
<div className="font-Cafe24Surround text-[0.875rem] text-wall-street dark:text-lazy-gray">{`${filteredSearchResList.length}건의 검색 결과 `}</div>
)}
<div className={`${type === 'role' && 'flex flex-col gap-6 pl-5 pr-5 pt-2'}`}>
<div
className={`${type === 'role' && searchResList && 'flex flex-col gap-6 pl-5 pr-5 pt-2'}`}
>
{filteredSearchResList?.map((searchRes) => {
if (type === 'title') {
const { _id, title, author, createdAt, likes, image, comments } = searchRes as Post;
Expand Down
File renamed without changes.

0 comments on commit 1ddd53e

Please sign in to comment.