39 lines
862 B
TypeScript
39 lines
862 B
TypeScript
import 'dotenv/config'
|
|
import { Screen, Box, Flow, Text, Button, interceptConsoleLog, ConsoleLog, iTerm2, Window, Flex } from 'wretched'
|
|
import * as utility from "wretched/dist/components/utility";
|
|
import { clientInvoicesView } from "./components/listClientInvoices.js";
|
|
|
|
|
|
|
|
interceptConsoleLog();
|
|
process.title = 'Wretched';
|
|
|
|
const consoleLog = new ConsoleLog({
|
|
height: 12,
|
|
})
|
|
const [screen, program] = await Screen.start(
|
|
async (program) => {
|
|
await iTerm2.setBackground(program, [23, 23, 23])
|
|
|
|
return new Window({
|
|
child: new utility.TrackMouse({
|
|
content: Flex.down({
|
|
children: [
|
|
['flex1', clientInvoicesView],
|
|
['natural', consoleLog],
|
|
],
|
|
}),
|
|
}),
|
|
})
|
|
},
|
|
)
|
|
|
|
program.key('escape', function () {
|
|
consoleLog.clear()
|
|
screen.render()
|
|
})
|
|
|
|
process.on("beforeExit", () => {
|
|
|
|
})
|