Refactor
This commit is contained in:
@@ -4,6 +4,8 @@ import { useState, useMemo, useEffect } from "react";
|
||||
import PropTypes from "prop-types";
|
||||
import Modal from "./Modal";
|
||||
import ProviderIcon from "./ProviderIcon";
|
||||
import CapacityBadges from "./CapacityBadges";
|
||||
import { useModelCaps } from "@/shared/hooks/useModelCaps";
|
||||
import { getModelsByProviderId, getModelKind } from "@/shared/constants/models";
|
||||
import { OAUTH_PROVIDERS, APIKEY_PROVIDERS, FREE_PROVIDERS, FREE_TIER_PROVIDERS, AI_PROVIDERS, isOpenAICompatibleProvider, isAnthropicCompatibleProvider, getProviderAlias } from "@/shared/constants/providers";
|
||||
|
||||
@@ -40,6 +42,7 @@ export default function ModelSelectModal({
|
||||
return kinds.includes(kindFilter);
|
||||
});
|
||||
}, [activeProviders, kindFilter]);
|
||||
const { getCaps } = useModelCaps();
|
||||
const [searchQuery, setSearchQuery] = useState("");
|
||||
const [combos, setCombos] = useState([]);
|
||||
const [providerNodes, setProviderNodes] = useState([]);
|
||||
@@ -499,9 +502,13 @@ export default function ModelSelectModal({
|
||||
<>
|
||||
{model.name}
|
||||
<span className="text-[9px] opacity-60 font-normal">custom</span>
|
||||
<CapacityBadges caps={getCaps(model.value)} />
|
||||
</>
|
||||
) : (
|
||||
model.name
|
||||
<>
|
||||
{model.name}
|
||||
<CapacityBadges caps={getCaps(model.value)} />
|
||||
</>
|
||||
)}
|
||||
</span>
|
||||
</button>
|
||||
|
||||
Reference in New Issue
Block a user