UNPKG

@shutootaki/gwm

Version:
19 lines 805 B
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime"; import { Box, Text } from 'ink'; const BORDER_COLOR = { success: 'green', error: 'red', warning: 'yellow', info: 'cyan', }; /** * 枠付き通知ボックス * * variant に応じて枠線とタイトルのカラーが変わる */ export const Notice = ({ title, messages = [], variant = 'info', }) => { const color = BORDER_COLOR[variant]; const messageLines = Array.isArray(messages) ? messages : [messages]; return (_jsxs(Box, { flexDirection: "column", borderStyle: "single", borderColor: color, padding: 1, children: [_jsx(Text, { color: color, bold: true, children: title }), messageLines.map((msg, idx) => (_jsx(Text, { color: "gray", children: msg }, idx)))] })); }; //# sourceMappingURL=Notice.js.map