import { useRef } from "react";
import { GlassMenu } from "@/components/ui/liquid-glass";
import {
IconChatRoundDots,
IconHeart,
IconHomeSmileAngle,
IconSettingGear,
} from "@devigner-ui/icons";
const items = [
{ id: "feed", label: "Feed", icon: <IconHomeSmileAngle className="size-6" /> },
{ id: "star", label: "Star", icon: <IconHeart className="size-6" /> },
{ id: "messages", label: "Messages", icon: <IconChatRoundDots className="size-6" /> },
{ id: "settings", label: "Settings", icon: <IconSettingGear className="size-6" /> },
];
// The image the shader bends. Same origin, or served with CORS.
const photo = "/night.jpg";
export function Example() {
const area = useRef<HTMLImageElement>(null);
return (
<div className="relative grid h-80 place-items-center">
<img ref={area} src={photo} alt="" className="absolute inset-0 size-full object-cover" />
<GlassMenu
items={items}
transparency={0.3}
backdrop={{ src: photo, area }}
onSelect={(id) => console.log(id)}
/>
</div>
);
}