🔧 chore: implement IconWithFrame common component

This commit is contained in:
Andre H 2024-02-28 13:39:30 +07:00
parent 89306ddcc7
commit 2585418ed6
2 changed files with 33 additions and 0 deletions

View File

@ -0,0 +1,32 @@
import React, { ReactNode } from 'react';
import { cn } from 'utils/classnames';
interface IconWithFrameProps {
icon: ReactNode;
bgClass?: string;
hasHighlight?: boolean;
}
export const IconWithFrame = ({
icon,
bgClass = 'bg-controls-secondary ',
hasHighlight = true,
}: IconWithFrameProps) => {
return (
<div
className={cn(
'relative justify-center items-center gap-2.5 inline-flex',
'w-16 h-16 rounded-2xl shadow-inner',
'border border-b-[3px] border-border-interactive border-opacity-10',
{
[bgClass]: true,
},
)}
>
{hasHighlight && (
<div className="bottom-0 absolute w-[37px] h-px bg-gradient-to-r from-gray-0/0 via-gray-0/50 to-gray-0/0" />
)}
{icon}
</div>
);
};

View File

@ -0,0 +1 @@
export * from './IconWithFrame';