45 lines
1.3 KiB
Dart
45 lines
1.3 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:lucide_icons_flutter/lucide_icons.dart' as lucide;
|
|
import 'package:shadcn_ui/shadcn_ui.dart';
|
|
|
|
/// 데이터가 없을 때 사용자에게 명확한 안내를 제공하는 공통 위젯.
|
|
class SuperportEmptyState extends StatelessWidget {
|
|
const SuperportEmptyState({
|
|
super.key,
|
|
required this.title,
|
|
this.description,
|
|
this.icon = lucide.LucideIcons.inbox,
|
|
this.action,
|
|
});
|
|
|
|
final String title;
|
|
final String? description;
|
|
final IconData? icon;
|
|
final Widget? action;
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
final theme = ShadTheme.of(context);
|
|
return Center(
|
|
child: Column(
|
|
mainAxisSize: MainAxisSize.min,
|
|
children: [
|
|
if (icon != null)
|
|
Icon(icon, size: 48, color: theme.colorScheme.mutedForeground),
|
|
const SizedBox(height: 16),
|
|
Text(title, style: theme.textTheme.h4),
|
|
if (description != null) ...[
|
|
const SizedBox(height: 8),
|
|
Text(
|
|
description!,
|
|
style: theme.textTheme.muted,
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
if (action != null) ...[const SizedBox(height: 20), action!],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|