Skip to content

Commit

Permalink
A little nicer, time to do more rendering cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
DrJKL committed Sep 4, 2023
1 parent 58c6767 commit 0d6502e
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions src/components/chunks/VariableView.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { Variable, VariableFlavor } from '@rendering/parsed_types';
import { KeyPath, pathToString } from '@rendering/rendering_utils';
import { PromptView } from './PromptView';
import { Badge, Tooltip } from '@mui/material';
import { Tooltip } from '@mui/material';

interface VariableProps extends KeyPath {
variable: Variable;
}

const FLAVOR_TO_SYMBOL: Record<VariableFlavor, string> = {
access: '',
assignment: '= ',
assignmentImmediate: '=!',
assignment: ' = ',
assignmentImmediate: ' =! ',
unknown: '¿¿',
};

Expand All @@ -22,10 +22,18 @@ export function VariableView({
}: VariableProps) {
return (
<Tooltip
title={`variable: ${variable.name}${FLAVOR_TO_SYMBOL[variable.flavor]}`}
title={
<div>
${'{'}
{variable.name}
{FLAVOR_TO_SYMBOL[variable.flavor]}
{'}'}
<br />
{pathToString('variable', path)}
</div>
}
color="primary">
<span
title={pathToString('variable', path)}
className={`${
fancy
? '' //'border-rose-600 border-opacity-50 border-2 rounded-md flex-[0_1_fit-content] inline-flex'
Expand Down

0 comments on commit 0d6502e

Please sign in to comment.