next-enterprise/components/Form/StatusField.tsx

32 lines
960 B
TypeScript
Raw Normal View History

2024-03-05 17:42:30 -05:00
/**
* StatusField Component
*
* Displays a status label with a customizable color. This component is typically used
* to indicate the status of a process or entity (e.g., success, error) within the application.
* Includes a visual separator and supports dynamic text and color customization through props.
*/
2024-03-03 22:09:33 -05:00
import React from "react"
2024-03-04 20:50:32 -05:00
import Separator from "./Separator"
2024-03-03 22:09:33 -05:00
2024-03-05 17:42:30 -05:00
interface StatusFieldProps {
label: string;
statusLabel: string;
statusColor: string;
}
const StatusField: React.FC<StatusFieldProps> = ({ label, statusLabel, statusColor }) => {
2024-03-03 22:09:33 -05:00
return (
2024-03-04 20:50:32 -05:00
<div className="flex flex-col gap-2">
<div className="flex flex-col gap-4">
<Separator/>
2024-03-04 23:33:49 -05:00
<h4 className="font-bold text-sm leading-tight text-indigo-900">{label}</h4>
2024-03-04 20:50:32 -05:00
</div>
2024-03-05 17:42:30 -05:00
{/* Dynamically styled based on status */}
2024-03-04 23:33:49 -05:00
<span className={`text-sm leading-tight ${statusColor}`}>{statusLabel}</span>
2024-03-03 22:09:33 -05:00
</div>
)
}
export default StatusField