-
-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce33cc0
commit c8ff2d8
Showing
22 changed files
with
1,804 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/bash | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
RATOS_BIN_CWD=$(pwd) | ||
export RATOS_BIN_CWD | ||
pnpm run --silent -C "$SCRIPT_DIR"/.. cli "$@" | ||
exit $? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { Box } from 'ink'; | ||
import React from 'react'; | ||
|
||
export const Container: React.FC<React.PropsWithChildren> = (props) => { | ||
return ( | ||
<Box padding={2} flexDirection="column"> | ||
{props.children} | ||
</Box> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { Box, Text } from 'ink'; | ||
import React from 'react'; | ||
|
||
interface APIResult { | ||
result: 'success' | 'error'; | ||
message: string; | ||
} | ||
|
||
interface StatusProps { | ||
results: APIResult | APIResult[]; | ||
} | ||
|
||
export const Status: React.FC<StatusProps> = (props) => { | ||
const hasError = Array.isArray(props.results) | ||
? props.results.some((result) => result.result === 'error') | ||
: props.results.result === 'error'; | ||
const results = Array.isArray(props.results) ? props.results : [props.results]; | ||
return ( | ||
<Box flexDirection="column"> | ||
{hasError ? <Text color="red">Error!</Text> : <Text color="green">Success!</Text>} | ||
{results.map(({ message, result }) => ( | ||
<Box key={message}> | ||
{result === 'success' ? ( | ||
<Text color="green" bold={true}> | ||
✓{' '} | ||
</Text> | ||
) : ( | ||
<Text color="red" bold={true}> | ||
✘{' '} | ||
</Text> | ||
)} | ||
<Text dimColor>{message}</Text> | ||
</Box> | ||
))} | ||
</Box> | ||
); | ||
}; |
Oops, something went wrong.