32 lines
882 B
Dart
32 lines
882 B
Dart
import "package:provider/provider.dart";
|
|
import "package:shadcn_flutter/shadcn_flutter.dart";
|
|
import "../../../../providers/chat_provider.dart";
|
|
import "../../../../utils/path_utils.dart";
|
|
import "tool_bubble_base.dart";
|
|
|
|
class ReadBubble extends StatelessWidget {
|
|
const ReadBubble({
|
|
super.key,
|
|
required this.input,
|
|
this.result,
|
|
this.isPendingPermission = false,
|
|
});
|
|
|
|
final Map<String, dynamic> input;
|
|
final String? result;
|
|
final bool isPendingPermission;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final projectRoot = context.read<ChatProvider>().workingDirectory;
|
|
final filePath = input["file_path"] as String? ?? "";
|
|
|
|
return ToolBubbleBase(
|
|
toolName: "Read",
|
|
icon: LucideIcons.fileText,
|
|
result: result,
|
|
isPendingPermission: isPendingPermission,
|
|
detail: shortenPath(filePath, projectRoot),
|
|
);
|
|
}
|
|
}
|