-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathListItem.tsx
42 lines (35 loc) · 1.19 KB
/
ListItem.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
"use client";
import { useRouter } from "next/navigation";
import React from "react";
import Image from "next/image";
import { FaPlay } from 'react-icons/fa';
interface ListItemProps {
image: string;
name: string;
href: string;
}
const ListItem: React.FC<ListItemProps> = ({
image,
name,
href
}) => {
const router = useRouter();
const onClick = () => {
// Add authentication before push
router.push(href);
}
return (
<button onClick={onClick} className=" relative group flex items-center rounded-md overflow-hidden gap-x-4 bg-neutral-100/10 hover:bg-neutral-100/20 transition pr-4">
<div className=" relative min-h-[64px] min-w-[64px]">
<Image className=" object-cover" fill src={image} alt="Image" />
</div>
<p className=" font-medium truncate py-5">
{name}
</p>
<div className=" absolute transition opacity-0 rounded-full flex items-center justify-center bg-green-500 p-4 drop-shadow-md right-5 group-hover:opacity-100 hover:scale-110">
<FaPlay className=" text-black" />
</div>
</button>
);
}
export default ListItem;