feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
import React from 'react';
|
|
|
|
|
import { cn } from '@/lib/utils';
|
|
|
|
|
|
|
|
|
|
interface CardProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface CardHeaderProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface CardContentProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface CardFooterProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
interface CardTitleProps extends React.HTMLAttributes<HTMLHeadingElement> {
|
|
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
2025-07-19 11:34:56 -06:00
|
|
|
interface CardDescriptionProps
|
|
|
|
|
extends React.HTMLAttributes<HTMLParagraphElement> {
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
children: React.ReactNode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const Card = React.forwardRef<HTMLDivElement, CardProps>(
|
|
|
|
|
({ className, children, ...props }, ref) => (
|
|
|
|
|
<div
|
|
|
|
|
ref={ref}
|
|
|
|
|
className={cn(
|
|
|
|
|
'rounded-lg border bg-card text-card-foreground shadow-sm',
|
2025-07-19 11:34:56 -06:00
|
|
|
className,
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
2025-07-19 11:34:56 -06:00
|
|
|
),
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
);
|
|
|
|
|
Card.displayName = 'Card';
|
|
|
|
|
|
|
|
|
|
const CardHeader = React.forwardRef<HTMLDivElement, CardHeaderProps>(
|
|
|
|
|
({ className, children, ...props }, ref) => (
|
|
|
|
|
<div
|
|
|
|
|
ref={ref}
|
|
|
|
|
className={cn('flex flex-col space-y-1.5 p-6', className)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
2025-07-19 11:34:56 -06:00
|
|
|
),
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
);
|
|
|
|
|
CardHeader.displayName = 'CardHeader';
|
|
|
|
|
|
|
|
|
|
const CardTitle = React.forwardRef<HTMLParagraphElement, CardTitleProps>(
|
|
|
|
|
({ className, children, ...props }, ref) => (
|
|
|
|
|
<h3
|
|
|
|
|
ref={ref}
|
|
|
|
|
className={cn(
|
|
|
|
|
'text-2xl font-semibold leading-none tracking-tight',
|
2025-07-19 11:34:56 -06:00
|
|
|
className,
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</h3>
|
2025-07-19 11:34:56 -06:00
|
|
|
),
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
);
|
|
|
|
|
CardTitle.displayName = 'CardTitle';
|
|
|
|
|
|
2025-07-19 11:34:56 -06:00
|
|
|
const CardDescription = React.forwardRef<
|
|
|
|
|
HTMLParagraphElement,
|
|
|
|
|
CardDescriptionProps
|
|
|
|
|
>(({ className, children, ...props }, ref) => (
|
|
|
|
|
<p
|
|
|
|
|
ref={ref}
|
|
|
|
|
className={cn('text-sm text-muted-foreground', className)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</p>
|
|
|
|
|
));
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
CardDescription.displayName = 'CardDescription';
|
|
|
|
|
|
|
|
|
|
const CardContent = React.forwardRef<HTMLDivElement, CardContentProps>(
|
|
|
|
|
({ className, children, ...props }, ref) => (
|
|
|
|
|
<div ref={ref} className={cn('p-6 pt-0', className)} {...props}>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
2025-07-19 11:34:56 -06:00
|
|
|
),
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
);
|
|
|
|
|
CardContent.displayName = 'CardContent';
|
|
|
|
|
|
|
|
|
|
const CardFooter = React.forwardRef<HTMLDivElement, CardFooterProps>(
|
|
|
|
|
({ className, children, ...props }, ref) => (
|
|
|
|
|
<div
|
|
|
|
|
ref={ref}
|
|
|
|
|
className={cn('flex items-center p-6 pt-0', className)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</div>
|
2025-07-19 11:34:56 -06:00
|
|
|
),
|
feat(dashboard): Implement Widget Configuration and Display Components
- Added WidgetConfigModal for creating and editing widgets with fields for title, sources, prompt, provider, model, and refresh frequency.
- Integrated MarkdownRenderer for displaying widget content previews.
- Created WidgetDisplay component to show widget details, including loading states, error handling, and source information.
- Developed a reusable Card component structure for consistent UI presentation.
- Introduced useDashboard hook for managing widget state, including adding, updating, deleting, and refreshing widgets.
- Implemented local storage management for dashboard state and settings.
- Added types for widgets, dashboard configuration, and API requests/responses to improve type safety and clarity.
2025-07-19 08:23:06 -06:00
|
|
|
);
|
|
|
|
|
CardFooter.displayName = 'CardFooter';
|
|
|
|
|
|
2025-07-19 11:34:56 -06:00
|
|
|
export {
|
|
|
|
|
Card,
|
|
|
|
|
CardHeader,
|
|
|
|
|
CardFooter,
|
|
|
|
|
CardTitle,
|
|
|
|
|
CardDescription,
|
|
|
|
|
CardContent,
|
|
|
|
|
};
|