| 127 | const { aiEnabled, aiProvider } = useSettings(); |
| 128 | |
| 129 | const fragments = (provider: AiProviderType) => { |
| 130 | switch (provider) { |
| 131 | case 'openai': |
| 132 | return ( |
| 133 | <div className="flex items-center gap-10 bg-sb-yellow-20 text-sb-yellow-80 rounded-sm text-sm font-medium px-3 py-2"> |
| 134 | <p>API key required</p> |
| 135 | <a href="https://platform.openai.com/api-keys" target="_blank" className="underline"> |
| 136 | Go to {aiProvider} |
| 137 | </a> |
| 138 | </div> |
| 139 | ); |
| 140 | |
| 141 | case 'anthropic': |
| 142 | return ( |
| 143 | <div className="flex items-center gap-10 bg-sb-yellow-20 text-sb-yellow-80 rounded-sm text-sm font-medium px-3 py-2"> |
| 144 | <p>API key required</p> |
| 145 | <a |
| 146 | href="https://console.anthropic.com/settings/keys" |
| 147 | target="_blank" |
| 148 | className="underline" |
| 149 | > |
| 150 | Go to {aiProvider} |
| 151 | </a> |
| 152 | </div> |
| 153 | ); |
| 154 | |
| 155 | case 'Xai': |
| 156 | return ( |
| 157 | <div className="flex items-center gap-10 bg-sb-yellow-20 text-sb-yellow-80 rounded-sm text-sm font-medium px-3 py-2"> |
| 158 | <p>API key required</p> |
| 159 | </div> |
| 160 | ); |
| 161 | |
| 162 | case 'Gemini': |
| 163 | return ( |
| 164 | <div className="flex items-center gap-10 bg-sb-yellow-20 text-sb-yellow-80 rounded-sm text-sm font-medium px-3 py-2"> |
| 165 | <p>API key required</p> |
| 166 | </div> |
| 167 | ); |
| 168 | |
| 169 | case 'openrouter': |
| 170 | return ( |
| 171 | <div className="flex items-center gap-10 bg-sb-yellow-20 text-sb-yellow-80 rounded-sm text-sm font-medium px-3 py-2"> |
| 172 | <p>API key required</p> |
| 173 | <a href="https://openrouter.ai/keys" target="_blank" className="underline"> |
| 174 | Go to {aiProvider} |
| 175 | </a> |
| 176 | </div> |
| 177 | ); |
| 178 | |
| 179 | case 'custom': |
| 180 | return ( |
| 181 | <div className="flex items-center gap-10 bg-sb-yellow-20 text-sb-yellow-80 rounded-sm text-sm font-medium px-3 py-2"> |
| 182 | <p>Base URL required</p> |
| 183 | </div> |
| 184 | ); |
| 185 | } |
| 186 | }; |