import PropTypes from "prop-types"; import { CapacityBadges } from "@/shared/components"; export default function ModelRow({ model, fullModel, alias, copied, onCopy, testStatus, isCustom, isFree, onDeleteAlias, onTest, isTesting, onDisable, caps }) { const borderColor = testStatus === "ok" ? "border-green-500/40" : testStatus === "error" ? "border-red-500/40" : "border-border"; const iconColor = testStatus === "ok" ? "#22c55e" : testStatus === "error" ? "#ef4444" : undefined; return (
{testStatus === "ok" ? "check_circle" : testStatus === "error" ? "cancel" : "smart_toy"}
{fullModel} {model.name && {model.name}}
{onTest && (
{isTesting ? "Testing..." : "Test"}
)}
{copied === `model-${model.id}` ? "Copied!" : "Copy"}
{isCustom ? ( ) : onDisable ? ( ) : null}
); } ModelRow.propTypes = { model: PropTypes.shape({ id: PropTypes.string.isRequired, }).isRequired, fullModel: PropTypes.string.isRequired, alias: PropTypes.string, copied: PropTypes.string, onCopy: PropTypes.func.isRequired, testStatus: PropTypes.oneOf(["ok", "error"]), isCustom: PropTypes.bool, isFree: PropTypes.bool, onDeleteAlias: PropTypes.func, onTest: PropTypes.func, isTesting: PropTypes.bool, onDisable: PropTypes.func, caps: PropTypes.object, };