1/** @jsxImportSource @alchemy.run/sigil */
2import { useGlyphs } from "./Environment.tsx";
3import { Stack } from "./Layout.tsx";
4import { Text } from "./Typography.tsx";
5
6type AnsweredPromptProps = {
7 readonly message: string;
8 readonly answer: string;
9 readonly below?: boolean;
10};
11
12export function AnsweredPrompt({
13 message,
14 answer,
15 below = false,
16}: AnsweredPromptProps) {
17 const glyphs = useGlyphs();
18 return below ? (
19 <Stack>
20 <Text>
21 <Text tone="success">{glyphs.success}</Text> {message}
22 </Text>
23 <Text tone="muted"> {answer}</Text>
24 </Stack>
25 ) : (
26 <Text>
27 <Text tone="success">{glyphs.success}</Text> {message}{" "}
28 <Text tone="muted">· {answer}</Text>
29 </Text>
30 );
31}
32
33type CancelledPromptProps = { readonly message: string };
34
35export function CancelledPrompt({ message }: CancelledPromptProps) {
36 const glyphs = useGlyphs();
37 return (
38 <Text tone="muted">
39 <Text tone="danger">{glyphs.error}</Text> {message} cancelled
40 </Text>
41 );
42}