Add anchor component
This commit is contained in:
parent
f844ca660f
commit
dde87bd086
20
src/back/jdd-components/anchor/anchor.jdd.tsx
Normal file
20
src/back/jdd-components/anchor/anchor.jdd.tsx
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
import { TempstreamJSX } from "tempstream";
|
||||||
|
import type { ComponentToHTMLArgs } from "@sealcode/jdd";
|
||||||
|
import { Component, ComponentArguments } from "@sealcode/jdd";
|
||||||
|
|
||||||
|
const component_arguments = {
|
||||||
|
id: new ComponentArguments.ShortText(),
|
||||||
|
} as const;
|
||||||
|
|
||||||
|
export class Anchor extends Component<typeof component_arguments> {
|
||||||
|
getArguments() {
|
||||||
|
return component_arguments;
|
||||||
|
}
|
||||||
|
|
||||||
|
async toHTML({
|
||||||
|
args: { id },
|
||||||
|
classes,
|
||||||
|
}: ComponentToHTMLArgs<typeof component_arguments>): Promise<string> {
|
||||||
|
return <div id={id} class={["anchor", "jdd-no-gap", ...classes]}></div>;
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user