Skip to content
Snippets Groups Projects
Verified Commit 18f5a1e0 authored by João Magalhães's avatar João Magalhães :rocket:
Browse files

feat: new components

parent ae290aa2
No related branches found
No related tags found
1 merge request!8Support for react.js components
Pipeline #1061 failed
export * from "./button/button";
export * from "./tuple/tuple";
export * from "./info/info";
export * from "./pair/pair";
import React, { FC } from "react";
import "./info.css";
type InfoProps = {
style?: string[];
};
export const Info: FC<InfoProps> = ({ style = [] }) => {
const classes = () => ["info", ...style].join(" ");
return <dl className={classes()}></dl>;
};
export default Info;
import React, { FC } from "react";
import "./tuple.css";
import "./pair.css";
type TupleProps = {
type PairProps = {
key: string;
value?: string;
style?: string[];
......@@ -10,14 +10,14 @@ type TupleProps = {
onValueClick?: () => void;
};
export const Tuple: FC<TupleProps> = ({
export const Pair: FC<PairProps> = ({
key,
value,
style = [],
onKeyClick,
onValueClick
}) => {
const classes = () => ["table-entry", ...style].join(" ");
const classes = () => ["pair", ...style].join(" ");
const _onKeyClick = () => (onKeyClick ? onKeyClick() : undefined);
const _onValueClick = () => (onValueClick ? onValueClick() : undefined);
return (
......@@ -32,4 +32,4 @@ export const Tuple: FC<TupleProps> = ({
);
};
export default Tuple;
export default Pair;
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment