mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-28 00:49:40 +05:00
feat: add user search
This commit is contained in:
parent
048bed7085
commit
ff3753a951
2 changed files with 38 additions and 1 deletions
33
app/components/UserSection/UserSection.tsx
Normal file
33
app/components/UserSection/UserSection.tsx
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { Avatar, Card } from "flowbite-react";
|
||||
import Link from "next/link";
|
||||
|
||||
export const UserSection = (props: { sectionTitle?: string; content: any }) => {
|
||||
return (
|
||||
<section>
|
||||
{props.sectionTitle && (
|
||||
<div className="flex justify-between px-4 py-2 border-b-2 border-black dark:border-white">
|
||||
<h1 className="font-bold text-md sm:text-xl md:text-lg xl:text-xl">
|
||||
{props.sectionTitle}
|
||||
</h1>
|
||||
</div>
|
||||
)}
|
||||
<div className="m-4">
|
||||
<div className="flex flex-wrap gap-4">
|
||||
{props.content.map((user) => {
|
||||
return (
|
||||
<Link href={`/profile/${user.id}`} key={user.id} className="w-full max-w-[234px] h-full max-h-[234px] aspect-square flex-shrink-0">
|
||||
<Card className="items-center justify-center w-full h-full">
|
||||
<Avatar img={user.avatar} alt={user.login} size="lg" rounded={true} />
|
||||
<h5 className="mb-1 text-xl font-medium text-gray-900 dark:text-white">
|
||||
{user.login}
|
||||
</h5>
|
||||
</Card>
|
||||
</Link>
|
||||
);
|
||||
})}
|
||||
{props.content.length == 1 && <div></div>}
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue