2024-03-14 01:52:31 +00:00
|
|
|
import { cn } from "~/utils";
|
|
|
|
import { Avatar } from "./ui/avatar";
|
|
|
|
import { Button } from "./ui/button";
|
2024-03-14 17:45:21 +00:00
|
|
|
import { EditIcon, FingerPrintIcon } from "./icons";
|
2024-03-14 01:52:31 +00:00
|
|
|
|
2024-03-19 01:42:32 +00:00
|
|
|
const ManagementCardAvatar = ({ src, onClick }: { src?: string; onClick?: () => void }) => {
|
2024-03-14 17:45:21 +00:00
|
|
|
return (
|
|
|
|
<div className="flex justify-center">
|
|
|
|
<div className="relative w-fit h-fit">
|
|
|
|
<Avatar className="border-2 border-ring h-28 w-28" />
|
|
|
|
<Button
|
2024-03-19 01:42:32 +00:00
|
|
|
onClick={onClick}
|
2024-03-14 17:45:21 +00:00
|
|
|
variant="outline"
|
2024-03-14 17:46:31 +00:00
|
|
|
className="absolute bottom-0 right-0 z-50 flex items-center w-10 h-10 p-0 border-white rounded-full justiyf-center hover:bg-secondary-2">
|
2024-03-14 17:45:21 +00:00
|
|
|
<EditIcon />
|
|
|
|
</Button>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2024-03-14 01:52:31 +00:00
|
|
|
|
2024-03-14 17:45:21 +00:00
|
|
|
const ManagementCardTitle = ({
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
}: React.PropsWithChildren<{ className?: string }>) => {
|
|
|
|
return (
|
2024-03-14 17:46:31 +00:00
|
|
|
<div className={cn("flex items-center gap-x-2 font-semibold", className)}>
|
2024-03-14 17:45:21 +00:00
|
|
|
<FingerPrintIcon className="text-ring" />
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2024-03-14 01:52:31 +00:00
|
|
|
|
2024-03-14 17:45:21 +00:00
|
|
|
const ManagementCardContent = ({
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
}: React.PropsWithChildren<{ className?: string }>) => {
|
|
|
|
return (
|
2024-03-14 17:46:31 +00:00
|
|
|
<div className={cn("mt-4 mb-8 text-sm text-primary-2", className)}>
|
2024-03-14 17:45:21 +00:00
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
2024-03-14 01:52:31 +00:00
|
|
|
};
|
|
|
|
|
2024-03-14 17:45:21 +00:00
|
|
|
const ManagementCardFooter = ({
|
|
|
|
children,
|
|
|
|
className,
|
|
|
|
}: React.PropsWithChildren<{ className?: string }>) => {
|
|
|
|
return <div className={className}>{children}</div>;
|
2024-03-14 01:52:31 +00:00
|
|
|
};
|
2024-03-14 17:45:21 +00:00
|
|
|
|
|
|
|
const ManagementCard = ({
|
|
|
|
children,
|
|
|
|
variant,
|
|
|
|
}: React.PropsWithChildren<{ variant?: string }>) => {
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
className={cn(
|
|
|
|
"rounded-lg p-8 border w-full border-[--variant-color]",
|
|
|
|
!variant && "[--variant-color:theme(colors.border)]",
|
|
|
|
variant === "accent" && "[--variant-color:theme(colors.primary-1.DEFAULT)]",
|
|
|
|
)}>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export {
|
|
|
|
ManagementCard,
|
|
|
|
ManagementCardAvatar,
|
|
|
|
ManagementCardContent,
|
|
|
|
ManagementCardFooter,
|
|
|
|
ManagementCardTitle,
|
|
|
|
};
|