From db50f42054da77cbef78b612494ee872aa66b147 Mon Sep 17 00:00:00 2001 From: Shivam Mishra Date: Wed, 7 May 2025 19:17:37 +0530 Subject: [PATCH] feat: kickstart ui --- app/javascript/entrypoints/ui.js | 31 ++++++++++++++++++++++++++++--- 1 file changed, 28 insertions(+), 3 deletions(-) diff --git a/app/javascript/entrypoints/ui.js b/app/javascript/entrypoints/ui.js index a17e3593f..81a2468e7 100644 --- a/app/javascript/entrypoints/ui.js +++ b/app/javascript/entrypoints/ui.js @@ -1,3 +1,28 @@ -export function greet() { - return 'Hello'; -} +import { h, createCustomElement } from 'vue'; + +const ChatButton = { + name: 'ChatButton', + props: { + label: { + type: String, + default: 'Click me', + }, + }, + render() { + return h( + 'button', + { + class: 'cha-button', + onClick: this.handleClick, + }, + this.label + ); + }, + methods: { + handleClick() { + // console.log('Button clicked'); + }, + }, +}; + +export const buttonElement = createCustomElement(ChatButton);