mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
27 lines
977 B
TypeScript
27 lines
977 B
TypeScript
import React from 'react';
|
|
import { cn } from '@/lib/cn';
|
|
import { interactiveSurfaceClass } from '@/components/ui/styles';
|
|
|
|
type Props<E extends React.ElementType = 'div'> = {
|
|
as?: E;
|
|
$hoverable?: boolean;
|
|
} & Omit<React.ComponentPropsWithoutRef<E>, 'as' | '$hoverable'>;
|
|
|
|
const GreyRowBox = <E extends React.ElementType = 'div'>({ as, $hoverable, className, ...props }: Props<E>) => {
|
|
const Component = (as || 'div') as React.ElementType;
|
|
|
|
return (
|
|
<Component
|
|
className={cn(
|
|
'flex rounded-sm no-underline text-foreground items-center bg-card p-4 border border-transparent overflow-hidden',
|
|
'[&_.icon]:flex [&_.icon]:w-16 [&_.icon]:items-center [&_.icon]:justify-center [&_.icon]:rounded-full [&_.icon]:bg-popover [&_.icon]:p-3',
|
|
$hoverable !== false && interactiveSurfaceClass,
|
|
className
|
|
)}
|
|
{...props}
|
|
/>
|
|
);
|
|
};
|
|
|
|
export default GreyRowBox;
|