[fix/feat:ui] Show default option badge (#3232)
Co-authored-by: Julius Marminge <[email protected]>
This commit is contained in:
1 parent
d0b9f8d40d
commit
c0e161af06
1 file changed
+18
-1
@@ -30,6 +30,7 @@ import {
|
||||
import { useComposerDraftStore, DraftId } from "../../composerDraftStore";
|
||||
import { getProviderModelCapabilities } from "../../providerModels";
|
||||
import { cn } from "~/lib/utils";
|
||||
import { Badge } from "../ui/badge";
|
||||
|
||||
type ProviderOptions = ReadonlyArray<ProviderOptionSelection>;
|
||||
|
||||
@@ -46,6 +47,17 @@ type TraitsPersistence =
|
||||
|
||||
const ULTRATHINK_PROMPT_PREFIX = "Ultrathink:\n";
|
||||
|
||||
function DefaultBadge() {
|
||||
return (
|
||||
<Badge
|
||||
variant="outline"
|
||||
className="inline-flex h-4 w-fit min-w-0 items-center justify-center gap-0 border-border/70 bg-muted/60 px-1.5 py-0 font-semibold text-[10px] text-muted-foreground leading-none sm:h-4"
|
||||
>
|
||||
Default
|
||||
</Badge>
|
||||
);
|
||||
}
|
||||
|
||||
function replaceDescriptorCurrentValue(
|
||||
descriptors: ReadonlyArray<ProviderOptionDescriptor>,
|
||||
descriptorId: string,
|
||||
@@ -313,7 +325,12 @@ export const TraitsMenuContent = memo(function TraitsMenuContentImpl({
|
||||
disabled={ultrathinkInBodyText && descriptor.id === primarySelectDescriptor?.id}
|
||||
>
|
||||
{option.label}
|
||||
{option.isDefault ? " (default)" : ""}
|
||||
{option.isDefault ? (
|
||||
<>
|
||||
{" "}
|
||||
<DefaultBadge />
|
||||
</>
|
||||
) : null}
|
||||
</MenuRadioItem>
|
||||
))}
|
||||
</MenuRadioGroup>
|
||||
|
||||
Reference in new issue
Block a user