From 2585418ed62e3f77322927dddb74dd8b4b5b5336 Mon Sep 17 00:00:00 2001 From: Andre H Date: Wed, 28 Feb 2024 13:39:30 +0700 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20chore:=20implement=20IconWithFra?= =?UTF-8?q?me=20common=20component?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../shared/IconWithFrame/IconWithFrame.tsx | 32 +++++++++++++++++++ .../components/shared/IconWithFrame/index.ts | 1 + 2 files changed, 33 insertions(+) create mode 100644 packages/frontend/src/components/shared/IconWithFrame/IconWithFrame.tsx create mode 100644 packages/frontend/src/components/shared/IconWithFrame/index.ts diff --git a/packages/frontend/src/components/shared/IconWithFrame/IconWithFrame.tsx b/packages/frontend/src/components/shared/IconWithFrame/IconWithFrame.tsx new file mode 100644 index 00000000..ab3f6a9a --- /dev/null +++ b/packages/frontend/src/components/shared/IconWithFrame/IconWithFrame.tsx @@ -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 ( +
+ {hasHighlight && ( +
+ )} + {icon} +
+ ); +}; diff --git a/packages/frontend/src/components/shared/IconWithFrame/index.ts b/packages/frontend/src/components/shared/IconWithFrame/index.ts new file mode 100644 index 00000000..a7d3a98e --- /dev/null +++ b/packages/frontend/src/components/shared/IconWithFrame/index.ts @@ -0,0 +1 @@ +export * from './IconWithFrame';