Something went wrong. Try again.
[READ-ONLY] Mirror of https://github.com/Schniz/cmd-ts. 💻 A type-driven command line argument parser cmd-ts.now.sh
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051import React from 'react';import cx from 'classnames';
export type Variant = 'code';export type Size = 'heading';
const aligns = { left: 'left', right: 'right', center: 'center',};
export function Text(props: { variant?: Size; style?: Variant; children: React.ReactNode; align?: keyof typeof aligns; className?: string;}) { const Tag = props.variant === 'heading' ? 'h1' : 'div'; return ( <> <Tag className={cx(props.className, { code: props.style === 'code', heading: props.variant === 'heading', normal: !props.style, })} style={{ textAlign: props.align, }} > {props.children} </Tag> <style jsx>{` .heading { font-size: 2em; }
.normal { font-family: Arial; } .code { font-family: Menlo, Monaco, Lucida Console, Liberation Mono, DejaVu Sans Mono, Bitstream Vera Sans Mono, Courier New, monospace; } `}</style> </> );}