Some checks failed
CI / lint-typecheck (pull_request) Failing after 10s
CI / tests (pull_request) Has been skipped
CI / contract-tests (pull_request) Has been skipped
CI / e2e-tests (pull_request) Has been skipped
CI / comment-pr (pull_request) Has been skipped
CI / commit-types (pull_request) Has been skipped
41 lines
1.0 KiB
TypeScript
41 lines
1.0 KiB
TypeScript
import { ReactNode } from 'react';
|
|
import { Card } from './Card';
|
|
import { Box } from './Box';
|
|
|
|
export interface ProfileCardProps {
|
|
identity: ReactNode;
|
|
stats?: ReactNode;
|
|
actions?: ReactNode;
|
|
variant?: 'default' | 'muted' | 'outline' | 'glass' | 'precision';
|
|
onClick?: () => void;
|
|
'data-testid'?: string;
|
|
}
|
|
|
|
export const ProfileCard = ({ identity, stats, actions, variant = 'default', onClick, 'data-testid': dataTestId }: ProfileCardProps) => {
|
|
return (
|
|
<Card
|
|
variant={variant}
|
|
padding="md"
|
|
onClick={onClick}
|
|
fullHeight
|
|
data-testid={dataTestId as string}
|
|
>
|
|
<Box display="flex" justifyContent="between" alignItems="start" gap={4}>
|
|
<Box flex={1} minWidth="0">
|
|
{identity}
|
|
</Box>
|
|
{actions && (
|
|
<Box flexShrink={0}>
|
|
{actions}
|
|
</Box>
|
|
)}
|
|
</Box>
|
|
{stats && (
|
|
<Box marginTop="auto" paddingTop={4} borderTop="1px solid var(--ui-color-border-muted)">
|
|
{stats}
|
|
</Box>
|
|
)}
|
|
</Card>
|
|
);
|
|
};
|