Bob AI: Add a glassmorphic badge containing a random funny fact abou
This commit is contained in:
22
src/components/common/GlassmorphicBadge.tsx
Normal file
22
src/components/common/GlassmorphicBadge.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
"use client";
|
||||
|
||||
import { useState, useEffect } from "react";
|
||||
import { getRandomFact } from "@/utils/facts";
|
||||
|
||||
export default function GlassmorphicBadge() {
|
||||
const [fact, setFact] = useState<string>("");
|
||||
|
||||
useEffect(() => {
|
||||
setFact(getRandomFact());
|
||||
}, []);
|
||||
|
||||
if (!fact) return null;
|
||||
|
||||
return (
|
||||
<div className="absolute bottom-4 right-4 z-20 max-w-[250px] p-3 rounded-[var(--radius)] shadow-lg text-xs
|
||||
bg-card/50 backdrop-blur-md border border-foreground/10 text-foreground">
|
||||
<p className="font-bold mb-1">Fun Fact!</p>
|
||||
<p>{fact}</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user