Skip to content

Commit

Permalink
fix: variables display bug
Browse files Browse the repository at this point in the history
  • Loading branch information
bryson-g committed Feb 7, 2025
1 parent 6bdc841 commit d3382df
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ import { VARIABLE_TYPES } from "@/app/constants";

export function ViewVariables({ variables }: { variables: VarNameAndVal[] }) {

console.log(variables)

return (
<Dialog>
<DialogTrigger asChild>
Expand All @@ -22,10 +24,10 @@ export function ViewVariables({ variables }: { variables: VarNameAndVal[] }) {
<DialogContent>
<div className="flex flex-col gap-3 w-fit max-h-[300px] overflow-y-auto">
{variables.map((variable) => {
const variableType = VARIABLE_TYPES[Object.keys(variable.value!)[0].toUpperCase() as keyof typeof VARIABLE_TYPES]
const variableType = VARIABLE_TYPES[Object.keys(variable.value!)[0]?.toUpperCase() as keyof typeof VARIABLE_TYPES]
return (
<div key={variable.varName} className="w-full flex gap-1 items-center">
<div className="rounded-lg flex items-center justify-center bg-yellow-100 p-1 text-xs font-semibold border border-black h-full">{variableType}</div>
{variableType && <div className="rounded-lg flex items-center justify-center bg-yellow-100 p-1 text-xs font-semibold border border-black h-full">{variableType}</div>}
<p className="text-xs font-bold text-purple-500 border text-center border-purple-500 rounded-lg p-2">{variable.varName}</p>
<p> = </p>
<div className={"px-2 border h-8 rounded-lg text-center max-w-96 text-nowrap min-h-5"} >
Expand Down

0 comments on commit d3382df

Please sign in to comment.