All files / src/apps/user/pages/agents/agent TabSection.tsx

0% Statements 0/5
0% Branches 0/4
0% Functions 0/3
0% Lines 0/5

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61                                                                                                                         
import React from "react";
 
export interface AgentTabSectionInterface {
  title: React.ReactNode;
  title_icon: React.ReactNode;
  fields: Record<string, React.ReactNode>;
  center_comp?: React.ReactNode;
  suffix_fields?: Record<string, React.ReactNode>;
  variant?: "none" | "darkblue" | "gradient1" | "gradient2";
}
 
const variantMapping = {
  none: "text-gray-800 dark:text-gray-100",
  darkblue: "bg-gray-900 text-white",
  gradient1: "gradient text-white",
  gradient2: "gradient2 text-white",
};
 
export const AgentTabSection: React.FC<AgentTabSectionInterface> = (props) => {
  return (
    <div
      className={`flex flex-col gap-4 p-4 rounded-lg ${
        variantMapping[props.variant ?? "none"]
      }`}
    >
      <div className="flex flex-row gap-2 items-center">
        {props.title_icon}
        <div className="font-bold text-2xl">{props.title}</div>
      </div>
      {Object.entries(props.fields).map(([k, v]) => {
        return (
          <p>
            <span className="font-bold">{k}:</span>
            <br></br> {v}
          </p>
        );
      })}
      {props.center_comp}
      {Object.entries(props.suffix_fields ?? {}).map(([k, v]) => {
        return (
          <p>
            <span className="font-bold">{k}:</span>
            <br></br> {v}
          </p>
        );
      })}
      {/* <p>
        <span className="font-bold underline">Temperature:</span>{" "}
        {agent.temperature}
      </p>
      <p>
        <span className="font-bold underline">Top-P:</span> {agent.top_p}
      </p>
      <p>
        <span className="font-bold underline">Max Tokens:</span>{" "}
        {agent.max_tokens}
      </p> */}
    </div>
  );
};