import { RouterOutputs, api } from "~/utils/api";
import { Scenario, type PromptVariant } from "./types";
import VariantHeader from "./VariantHeader";
import OutputCell from "./OutputCell";
import ScenarioHeader from "./ScenarioHeader";
import React, { useState } from "react";
import { Box, Grid, GridItem, Heading } from "@chakra-ui/react";
import NewScenarioButton from "./NewScenarioButton";
const ScenarioRow = (props: { scenario: Scenario; variants: PromptVariant[] }) => {
const [isHovered, setIsHovered] = useState(false);
const highlightStyle = {
backgroundColor: "gray.50", // or any color you prefer
};
return (
setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
sx={isHovered ? highlightStyle : null}
>
{props.variants.map((variant) => (
setIsHovered(true)}
onMouseLeave={() => setIsHovered(false)}
sx={isHovered ? highlightStyle : null}
>
))}
);
};
export default function OutputsTable({ experimentId }: { experimentId: string | undefined }) {
const variants = api.promptVariants.list.useQuery(
{ experimentId: experimentId as string },
{ enabled: !!experimentId }
);
const scenarios = api.scenarios.list.useQuery(
{ experimentId: experimentId as string },
{ enabled: !!experimentId }
);
if (!variants.data || !scenarios.data) return null;
return (
*": {
borderColor: "gray.300",
borderBottomWidth: 1,
borderRightWidth: 1,
paddingX: 4,
paddingY: 2,
},
"> *:last-child": {
borderRightWidth: 0,
},
}}
>
Scenario
{variants.data.map((variant) => (
))}
{scenarios.data.map((scenario) => (
))}
);
}