import { mount, signal, Text, View } from "nsh";
import { Window } from "nsh/desktop";
import { Badge, Counter, Format } from "__SPECIFIER__";
// Its count lives in Rust (`__EXT__/src/lib.rs`).
const counter = new Counter();
function App() {
const count = signal(counter.count);
return (
<View
style={{
flex: 1,
paddingTop: "env(safe-area-inset-top)",
paddingRight: "env(safe-area-inset-right)",
paddingBottom: "env(safe-area-inset-bottom)",
paddingLeft: "env(safe-area-inset-left)",
alignItems: "center", justifyContent: "center", gap: 16,
}}
>
<Text class="text-foreground" style={{ fontSize: 22 }}>{count() ? `Pressed ${Format.times(count())}` : "Not pressed yet"}</Text>
<Badge label="Press me" onPress={() => count.set(counter.increment())} />
</View>
);
}
mount(() => <Window id="main">{App}</Window>);