mirror of
https://github.com/claude-code-best/claude-code.git
synced 2026-06-18 22:35:51 +00:00
style(B1-4): 格式化 components/PromptInput,FeedbackSurvey,tasks,agents,skills,design-system,wizard (73 files)
纯格式化:移除分号、React Compiler import、import 多行展开。 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
import { c as _c } from "react/compiler-runtime";
|
||||
import figures from 'figures';
|
||||
import React from 'react';
|
||||
import { Text } from '../../ink.js';
|
||||
type Status = 'success' | 'error' | 'warning' | 'info' | 'pending' | 'loading';
|
||||
import figures from 'figures'
|
||||
import React from 'react'
|
||||
import { Text } from '../../ink.js'
|
||||
|
||||
type Status = 'success' | 'error' | 'warning' | 'info' | 'pending' | 'loading'
|
||||
|
||||
type Props = {
|
||||
/**
|
||||
* The status to display. Determines both the icon and color.
|
||||
@@ -14,42 +15,28 @@ type Props = {
|
||||
* - `pending`: Dimmed circle (○)
|
||||
* - `loading`: Dimmed ellipsis (…)
|
||||
*/
|
||||
status: Status;
|
||||
status: Status
|
||||
/**
|
||||
* Include a trailing space after the icon. Useful when followed by text.
|
||||
* @default false
|
||||
*/
|
||||
withSpace?: boolean;
|
||||
};
|
||||
const STATUS_CONFIG: Record<Status, {
|
||||
icon: string;
|
||||
color: 'success' | 'error' | 'warning' | 'suggestion' | undefined;
|
||||
}> = {
|
||||
success: {
|
||||
icon: figures.tick,
|
||||
color: 'success'
|
||||
},
|
||||
error: {
|
||||
icon: figures.cross,
|
||||
color: 'error'
|
||||
},
|
||||
warning: {
|
||||
icon: figures.warning,
|
||||
color: 'warning'
|
||||
},
|
||||
info: {
|
||||
icon: figures.info,
|
||||
color: 'suggestion'
|
||||
},
|
||||
pending: {
|
||||
icon: figures.circle,
|
||||
color: undefined
|
||||
},
|
||||
loading: {
|
||||
icon: '…',
|
||||
color: undefined
|
||||
withSpace?: boolean
|
||||
}
|
||||
|
||||
const STATUS_CONFIG: Record<
|
||||
Status,
|
||||
{
|
||||
icon: string
|
||||
color: 'success' | 'error' | 'warning' | 'suggestion' | undefined
|
||||
}
|
||||
};
|
||||
> = {
|
||||
success: { icon: figures.tick, color: 'success' },
|
||||
error: { icon: figures.cross, color: 'error' },
|
||||
warning: { icon: figures.warning, color: 'warning' },
|
||||
info: { icon: figures.info, color: 'suggestion' },
|
||||
pending: { icon: figures.circle, color: undefined },
|
||||
loading: { icon: '…', color: undefined },
|
||||
}
|
||||
|
||||
/**
|
||||
* Renders a status indicator icon with appropriate color.
|
||||
@@ -69,26 +56,16 @@ const STATUS_CONFIG: Record<Status, {
|
||||
* Waiting for response
|
||||
* </Text>
|
||||
*/
|
||||
export function StatusIcon(t0) {
|
||||
const $ = _c(5);
|
||||
const {
|
||||
status,
|
||||
withSpace: t1
|
||||
} = t0;
|
||||
const withSpace = t1 === undefined ? false : t1;
|
||||
const config = STATUS_CONFIG[status];
|
||||
const t2 = !config.color;
|
||||
const t3 = withSpace && " ";
|
||||
let t4;
|
||||
if ($[0] !== config.color || $[1] !== config.icon || $[2] !== t2 || $[3] !== t3) {
|
||||
t4 = <Text color={config.color} dimColor={t2}>{config.icon}{t3}</Text>;
|
||||
$[0] = config.color;
|
||||
$[1] = config.icon;
|
||||
$[2] = t2;
|
||||
$[3] = t3;
|
||||
$[4] = t4;
|
||||
} else {
|
||||
t4 = $[4];
|
||||
}
|
||||
return t4;
|
||||
export function StatusIcon({
|
||||
status,
|
||||
withSpace = false,
|
||||
}: Props): React.ReactNode {
|
||||
const config = STATUS_CONFIG[status]
|
||||
|
||||
return (
|
||||
<Text color={config.color} dimColor={!config.color}>
|
||||
{config.icon}
|
||||
{withSpace && ' '}
|
||||
</Text>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user