(ns hooks.macros.components
  (:require [clj-kondo.hooks-api :as api]
            [clojure.string :refer [capitalize]]))


(defn defcomponent [{:keys [node]}]
  (let [[name fields & [generator constructor destructor]] (rest (:children node))
        constructor (symbol (str "->Component" (capitalize name)))
        map-constructor (symbol (str "map->Component" (capitalize name)))
        generator (symbol (str "" name))]
    (println name)
    (println "wutwut")

    {:node (api/list-node
            [(api/token-node 'declare)
             (api/token-node constructor)
             (api/token-node map-constructor)
             (api/token-node generator)])}))
