microsoft/typespec

Public

mirrored from https://github.com/microsoft/typespecAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
3fdd7fc5612f6f0db1446a76d6a915c10330db22

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

packages/html-program-viewer/src/common.tsx

49lines · modecode

1import React, { FunctionComponent, PropsWithChildren } from "react";
2
3export const Group: FunctionComponent<PropsWithChildren<{}>> = ({ children }) => {
4 return <div className="group">{children}</div>;
5};
6
7export interface SectionProps {
8 title: string;
9 id?: string;
10 hide?: boolean;
11}
12
13export const Section: FunctionComponent<PropsWithChildren<SectionProps>> = ({
14 id,
15 title,
16 hide,
17 children,
18}) => {
19 if (hide) {
20 return <div></div>;
21 }
22 return (
23 <div className="section" id={id}>
24 <div className="section-title">{title}</div>
25 <div className="section-content">{children}</div>
26 </div>
27 );
28};
29
30export const Item: FunctionComponent<PropsWithChildren<SectionProps>> = ({
31 id,
32 title,
33 hide,
34 children,
35}) => {
36 if (hide) {
37 return <div></div>;
38 }
39 return (
40 <div className="item" id={id}>
41 <div className="item-title">{title}</div>
42 <div className="item-content">{children}</div>
43 </div>
44 );
45};
46
47export const Literal: FunctionComponent<PropsWithChildren<{}>> = ({ children }) => {
48 return <div className="literal">{children}</div>;
49};