-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2ee1416
commit f1b45f0
Showing
1 changed file
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from "react"; | ||
|
||
interface TooltipProps { | ||
message: string; | ||
children: React.ReactNode; | ||
} | ||
|
||
export default function Tooltip({ message, children }: TooltipProps) { | ||
return ( | ||
<div className="group relative flex max-w-max flex-col items-center justify-center"> | ||
{children} | ||
<div className="absolute bottom-7 left-1/2 z-10 ml-auto mr-auto min-w-max -translate-x-1/2 rotate-180 scale-0 transform rounded-xl px-3 py-2 text-xs font-medium transition-all duration-500 group-hover:scale-100"> | ||
<div className="flex max-w-xs flex-col items-center shadow-lg"> | ||
<div className="clip-bottom h-2 w-4 bg-primary/90"></div> | ||
<div className="w-[25ch] rotate-180 cursor-default rounded bg-primary/90 p-2 text-center text-xs text-white"> | ||
{message} | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
); | ||
} |