2025-01-19 15:24:03 +00:00
|
|
|
import React from 'react';
|
2025-01-19 17:31:46 +00:00
|
|
|
import Text from '~/components/Text';
|
2025-01-28 17:46:16 -05:00
|
|
|
import Title from '~/components/Title';
|
|
|
|
|
import cn from '~/utils/cn';
|
2024-03-29 15:41:10 -04:00
|
|
|
|
2025-01-19 15:24:03 +00:00
|
|
|
interface Props extends React.HTMLProps<HTMLDivElement> {
|
|
|
|
|
variant?: 'raised' | 'flat';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function Card({ variant = 'raised', ...props }: Props) {
|
2024-03-29 15:41:10 -04:00
|
|
|
return (
|
|
|
|
|
<div
|
2024-12-31 10:30:14 +05:30
|
|
|
{...props}
|
2024-05-05 23:38:41 -04:00
|
|
|
className={cn(
|
2025-02-01 15:28:04 -05:00
|
|
|
'w-full max-w-md rounded-3xl p-5',
|
2025-01-19 15:24:03 +00:00
|
|
|
variant === 'flat'
|
2024-05-05 23:38:41 -04:00
|
|
|
? 'bg-transparent shadow-none'
|
2025-05-29 09:45:47 -04:00
|
|
|
: 'bg-headplane-50/50 dark:bg-headplane-950/50 shadow-xs',
|
2025-01-19 15:24:03 +00:00
|
|
|
'border border-headplane-100 dark:border-headplane-800',
|
2024-12-31 10:30:14 +05:30
|
|
|
props.className,
|
2024-03-29 15:41:10 -04:00
|
|
|
)}
|
|
|
|
|
>
|
2024-12-31 10:30:14 +05:30
|
|
|
{props.children}
|
2024-03-29 15:41:10 -04:00
|
|
|
</div>
|
2024-12-31 10:30:14 +05:30
|
|
|
);
|
2024-03-29 15:41:10 -04:00
|
|
|
}
|
2024-05-05 23:38:41 -04:00
|
|
|
|
2024-12-31 10:30:14 +05:30
|
|
|
export default Object.assign(Card, { Title, Text });
|