44 lines
1.2 KiB
Dart
44 lines
1.2 KiB
Dart
import "dart:convert";
|
|
import "package:shadcn_flutter/shadcn_flutter.dart";
|
|
import "../permission_decision.dart";
|
|
import "tool_bubble_base.dart";
|
|
|
|
class DefaultToolBubble extends StatelessWidget {
|
|
const DefaultToolBubble({
|
|
super.key,
|
|
required this.toolName,
|
|
this.input,
|
|
this.result,
|
|
this.pendingPermission,
|
|
});
|
|
|
|
final String toolName;
|
|
final Map<String, dynamic>? input;
|
|
final String? result;
|
|
final PendingPermission? pendingPermission;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = Theme.of(context);
|
|
|
|
return ToolBubbleBase(
|
|
toolName: toolName,
|
|
icon: LucideIcons.wrench,
|
|
result: result,
|
|
pendingPermission: pendingPermission,
|
|
body: input != null && input!.isNotEmpty
|
|
? Padding(
|
|
padding: const EdgeInsets.only(left: 4),
|
|
child: Text(
|
|
const JsonEncoder.withIndent(" ").convert(input),
|
|
style: theme.typography.p.copyWith(
|
|
fontSize: 12,
|
|
color: theme.colorScheme.mutedForeground,
|
|
fontFamily: "monospace",
|
|
),
|
|
),
|
|
)
|
|
: null,
|
|
);
|
|
}
|
|
}
|