import { css } from "@linaria/core";
import { string } from "vue-types";
import { Text } from "../../..";
import { createUIComp } from "../../../defines/createUIComp";
import { useCompData } from ".";

export const Component = createUIComp({
  props: {
    compId: string().isRequired,
  },
  setup(props) {
    const { value, children } = useCompData(props.compId);
    return () => (
      <>
        <Text.Component compId={children.title.id} />
        <Text.Component
          class={compStyle}
          style={{
            "--theme-color": value.themeColor,
          }}
          compId={children.subTitle.id}
        />
      </>
    );
  },
});

const compStyle = css`
  width: 3rem;
  margin: 0 auto;
  border-top: 1px solid;
  border-bottom: 1px solid;
  border-color: var(--theme-color);
`;
