mirror of
https://github.com/OneUptime/oneuptime.git
synced 2026-04-06 00:32:12 +02:00
31 lines
872 B
TypeScript
31 lines
872 B
TypeScript
import FieldLabelElement from "../Detail/FieldLabel";
|
|
import React, { FunctionComponent, ReactElement } from "react";
|
|
|
|
export interface ComponentProps {
|
|
title: string;
|
|
value: string | ReactElement;
|
|
className?: string;
|
|
textClassName?: string;
|
|
onClick?: (() => void) | undefined;
|
|
}
|
|
|
|
const InfoCard: FunctionComponent<ComponentProps> = (
|
|
props: ComponentProps,
|
|
): ReactElement => {
|
|
return (
|
|
<div
|
|
onClick={props.onClick}
|
|
className={`rounded-xl bg-white border border-gray-200 shadow-sm hover:shadow-md transition-shadow duration-200 p-5 ${props.onClick ? "cursor-pointer" : ""} ${props.className || ""}`}
|
|
>
|
|
<div className="mb-2">
|
|
<FieldLabelElement title={props.title} />
|
|
</div>
|
|
<div className={props.textClassName || "text-gray-900"}>
|
|
{props.value}
|
|
</div>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default InfoCard;
|