style: format codebase with Prettier\n\n- Apply Prettier across src to ensure consistent styling\n- No functional changes; whitespace and ordering only\n- Unblocks format:check for release pipeline

This commit is contained in:
Jason
2025-09-13 15:36:43 +08:00
parent c8327f7632
commit 6df5dfc123
14 changed files with 203 additions and 158 deletions

View File

@@ -25,7 +25,11 @@ const PresetSelector: React.FC<PresetSelectorProps> = ({
onCustomClick,
customLabel = "自定义",
}) => {
const getButtonClass = (index: number, isOfficial?: boolean, category?: ProviderCategory) => {
const getButtonClass = (
index: number,
isOfficial?: boolean,
category?: ProviderCategory,
) => {
const isSelected = selectedIndex === index;
const baseClass =
"inline-flex items-center gap-2 px-4 py-2 rounded-lg text-sm font-medium transition-colors";
@@ -63,7 +67,7 @@ const PresetSelector: React.FC<PresetSelectorProps> = ({
<div className="flex flex-wrap gap-2">
<button
type="button"
className={`${getButtonClass(-1)} ${selectedIndex === -1 ? '' : ''}`}
className={`${getButtonClass(-1)} ${selectedIndex === -1 ? "" : ""}`}
onClick={onCustomClick}
>
{customLabel}
@@ -72,19 +76,23 @@ const PresetSelector: React.FC<PresetSelectorProps> = ({
<button
key={index}
type="button"
className={getButtonClass(index, preset.isOfficial, preset.category)}
className={getButtonClass(
index,
preset.isOfficial,
preset.category,
)}
onClick={() => onSelectPreset(index)}
>
{(preset.isOfficial || preset.category === "official") && <Zap size={14} />}
{(preset.isOfficial || preset.category === "official") && (
<Zap size={14} />
)}
{preset.name}
</button>
))}
</div>
</div>
{getDescription() && (
<p className="text-sm text-gray-500">
{getDescription()}
</p>
<p className="text-sm text-gray-500">{getDescription()}</p>
)}
</div>
);