♻️ refactor: extract bookmark logic from banner component
This commit is contained in:
23
features/home/sections/Hero/components/AddToList.tsx
Normal file
23
features/home/sections/Hero/components/AddToList.tsx
Normal file
@ -0,0 +1,23 @@
|
||||
import { useAuth } from "@/shared/contexts/AuthContext";
|
||||
import { Button } from "@/shared/libs/shadcn/ui/button";
|
||||
import { Icon } from "@iconify/react";
|
||||
|
||||
const AddToList = ({ mediaId }: { mediaId: string }) => {
|
||||
const { session } = useAuth();
|
||||
|
||||
return (
|
||||
<div>
|
||||
{session?.user && (
|
||||
<Button
|
||||
variant="secondary"
|
||||
className="h-full flex gap-1 px-4 rounded-xl border border-neutral-400/10 bg-neutral-950/20 hover:bg-neutral-950/40 backdrop-blur-lg text-neutral-200"
|
||||
>
|
||||
<Icon icon="boxicons:bookmark" className="size-5.5" />
|
||||
<span>Add to List</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default AddToList;
|
||||
Reference in New Issue
Block a user