Skip to content

Commit cc9399d

Browse files
committed
Credential tags
1 parent 0dd70b7 commit cc9399d

File tree

1 file changed

+7
-3
lines changed
  • apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags

1 file changed

+7
-3
lines changed

apps/sim/app/workspace/[workspaceId]/home/components/message-content/components/special-tags/special-tags.tsx

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ export interface UsageUpgradeTagData {
2020
}
2121

2222
export interface CredentialTagData {
23-
link: string
24-
provider: string
23+
value: string
24+
type: 'env_key' | 'oauth_key' | 'sim_key' | 'link'
25+
provider?: string
26+
credential_id?: string
2527
}
2628

2729
export type ContentSegment =
@@ -254,11 +256,13 @@ const LockIcon = (props: { className?: string }) => (
254256
)
255257

256258
function CredentialDisplay({ data }: { data: CredentialTagData }) {
259+
if (data.type !== 'link' || !data.provider) return null
260+
257261
const Icon = getCredentialIcon(data.provider) ?? LockIcon
258262

259263
return (
260264
<a
261-
href={data.link}
265+
href={data.value}
262266
target='_blank'
263267
rel='noopener noreferrer'
264268
className='flex animate-stream-fade-in items-center gap-[8px] rounded-lg border border-[var(--divider)] px-3 py-2.5 transition-colors hover:bg-[var(--surface-5)]'

0 commit comments

Comments
 (0)