Cleaned up transcriptioncard

This commit is contained in:
Beingpax 2025-10-04 23:23:27 +05:45
parent 602654e733
commit eefee8d9d6

View File

@ -58,42 +58,21 @@ struct TranscriptionCard: View {
} }
private var originalContentView: some View { private var originalContentView: some View {
VStack(alignment: .leading, spacing: 8) { Text(transcription.text)
Text("Original") .font(.system(size: 15, weight: .regular, design: .default))
.font(.system(size: 14, weight: .medium)) .lineSpacing(2)
.foregroundColor(.secondary) .textSelection(.enabled)
Text(transcription.text)
.font(.system(size: 15, weight: .regular, design: .default))
.lineSpacing(2)
.textSelection(.enabled)
}
} }
private func enhancedContentView(_ enhancedText: String) -> some View { private func enhancedContentView(_ enhancedText: String) -> some View {
VStack(alignment: .leading, spacing: 8) { Text(enhancedText)
HStack(spacing: 4) { .font(.system(size: 15, weight: .regular, design: .default))
Image(systemName: "sparkles") .lineSpacing(2)
.foregroundColor(.blue) .textSelection(.enabled)
Text("Enhanced")
.font(.system(size: 14, weight: .medium))
.foregroundColor(.blue)
}
Text(enhancedText)
.font(.system(size: 15, weight: .regular, design: .default))
.lineSpacing(2)
.textSelection(.enabled)
}
} }
private var aiRequestContentView: some View { private var aiRequestContentView: some View {
VStack(alignment: .leading, spacing: 12) { VStack(alignment: .leading, spacing: 12) {
HStack(spacing: 6) {
Image(systemName: "paperplane.fill")
.foregroundColor(.purple)
Text("AI Request")
.font(.system(size: 14, weight: .semibold))
.foregroundColor(.purple)
}
if let systemMsg = transcription.aiRequestSystemMessage, !systemMsg.isEmpty { if let systemMsg = transcription.aiRequestSystemMessage, !systemMsg.isEmpty {
VStack(alignment: .leading, spacing: 6) { VStack(alignment: .leading, spacing: 6) {
@ -135,7 +114,7 @@ struct TranscriptionCard: View {
.padding(.vertical, 6) .padding(.vertical, 6)
.background( .background(
RoundedRectangle(cornerRadius: 16) RoundedRectangle(cornerRadius: 16)
.fill(isSelected ? Color.accentColor : Color.clear) .fill(isSelected ? Color.accentColor.opacity(0.75) : Color.clear)
.overlay( .overlay(
RoundedRectangle(cornerRadius: 16) RoundedRectangle(cornerRadius: 16)
.stroke(isSelected ? Color.clear : Color.secondary.opacity(0.3), lineWidth: 1) .stroke(isSelected ? Color.clear : Color.secondary.opacity(0.3), lineWidth: 1)
@ -174,23 +153,21 @@ struct TranscriptionCard: View {
} }
if isExpanded { if isExpanded {
if availableTabs.count > 1 { HStack(spacing: 2) {
HStack(spacing: 2) { ForEach(availableTabs, id: \.self) { tab in
ForEach(availableTabs, id: \.self) { tab in TabButton(
TabButton( title: tab.rawValue,
title: tab.rawValue, isSelected: selectedTab == tab,
isSelected: selectedTab == tab, action: { selectedTab = tab }
action: { selectedTab = tab } )
)
}
Spacer()
AnimatedCopyButton(textToCopy: copyTextForCurrentTab)
} }
.padding(.vertical, 8)
.padding(.horizontal, 4) Spacer()
AnimatedCopyButton(textToCopy: copyTextForCurrentTab)
} }
.padding(.vertical, 8)
.padding(.horizontal, 4)
ScrollView { ScrollView {
VStack(alignment: .leading, spacing: 12) { VStack(alignment: .leading, spacing: 12) {