stopped invoking btn class
This commit is contained in:
parent
036f76d878
commit
284662fe36
|
@ -3,6 +3,7 @@ import style from "./styles/buttons8831.scss"
|
|||
|
||||
// Import the JSON data
|
||||
import buttonsData from "./buttons.json"
|
||||
import { List } from "mdast-util-to-hast/lib/handlers/list"
|
||||
|
||||
export default (() => {
|
||||
// Define the component
|
||||
|
@ -40,14 +41,14 @@ export default (() => {
|
|||
}
|
||||
|
||||
// Function to group buttons by type
|
||||
function groupButtonsByType(buttons) {
|
||||
const groups = {
|
||||
function groupButtonsByType(buttons: any[]) {
|
||||
const groups: { [key: string]: any[] } = {
|
||||
misc: [],
|
||||
friend: [],
|
||||
standard: [],
|
||||
}
|
||||
|
||||
buttons.forEach((button) => {
|
||||
buttons.forEach((button: any) => {
|
||||
let type = button.type?.toLowerCase() || "standard"
|
||||
if (type === "fren") type = "friend"
|
||||
if (!groups[type]) type = "standard" // Default to 'standard' if type is unrecognized
|
||||
|
@ -58,7 +59,7 @@ export default (() => {
|
|||
}
|
||||
|
||||
// Function to render button content based on contentType
|
||||
function renderButtonContent(button) {
|
||||
function renderButtonContent(button: any): preact.VNode | null {
|
||||
const contentType = button.contentType || "image" // Default to 'image'
|
||||
|
||||
if (contentType === "image") {
|
||||
|
@ -80,4 +81,4 @@ export default (() => {
|
|||
Btn8831.css = style
|
||||
|
||||
return Btn8831
|
||||
})() satisfies QuartzComponentConstructor
|
||||
}) satisfies QuartzComponentConstructor
|
||||
|
|
Loading…
Reference in a new issue