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

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

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