mirror of
https://github.com/wassname/talk.git
synced 2026-07-19 11:28:50 +08:00
initial work
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
import React, { StatelessComponent } from "react";
|
||||
|
||||
export type View = "MODERATE" | "%future added value";
|
||||
|
||||
export interface AppProps {
|
||||
view: View;
|
||||
}
|
||||
|
||||
const renderView = (view: View) => {
|
||||
switch (view) {
|
||||
case "MODERATE":
|
||||
return <div>Moderate</div>;
|
||||
default:
|
||||
throw new Error(`Unknown view ${view}`);
|
||||
}
|
||||
};
|
||||
|
||||
const App: StatelessComponent<AppProps> = ({ view }) => (
|
||||
<div>{renderView(view)}</div>
|
||||
);
|
||||
|
||||
export default App;
|
||||
Reference in New Issue
Block a user