Skip to content

Commit

Permalink
feat(admin): GrayCard componet now has a "as" property for overriding…
Browse files Browse the repository at this point in the history
… base Element type
  • Loading branch information
agarbe committed Nov 11, 2024
1 parent 0645d19 commit b8936ce
Showing 1 changed file with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,20 @@ export const GrayCard = ({
children,
className,
"data-test": dataTest,
as = "li",
}: {
children: ReactNode;
className?: string;
"data-test"?: string;
}) => (
<li
data-test={dataTest}
className={`bg-neutral-100 p-4 sm:p-6 flex flex-col ${className || ""}`}
>
{children}
</li>
);
as?: React.ElementType;
}) => {
const Component = as;
return (
<Component
data-test={dataTest}
className={`bg-neutral-100 p-4 sm:p-6 flex flex-col ${className || ""}`}
>
{children}
</Component>
);
};

0 comments on commit b8936ce

Please sign in to comment.