Skip to content

Commit

Permalink
edit place holder
Browse files Browse the repository at this point in the history
  • Loading branch information
yliuuuu committed Jan 17, 2024
1 parent df0c61f commit 43be357
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/component/Editor/Editor.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@ export function Editor(props) {
}
}

function getPlaceHolder(tag) {
if (props.tag === EDITOR_TAG.QUERY) {
return "SELECT * FROM env"
} else {
return "{ 'env' : <<1,2,3>> }"
}
}

return (
<Stack direction="column" height={props.height-35} width='100%'>
{(props.tag !== "result") &&
Expand All @@ -39,7 +47,7 @@ export function Editor(props) {
theme="tomorrow_night"
placeholder={(() => {
if (props.value == null) {
return "enter " + props.tag + " here"
return getPlaceHolder(props.tag)
} else {
return null
}
Expand Down

0 comments on commit 43be357

Please sign in to comment.