"use client"; import { Plus, Key } from "lucide-react"; import { Button, Skeleton } from "../../../shadcnui"; import { SectionHeader } from "../../../components/typography"; import { OAuthClientCard } from "./OAuthClientCard"; import { OAuthClientInterface } from "../interfaces/oauth.interface"; export interface OAuthClientListProps { /** List of OAuth clients */ clients: OAuthClientInterface[]; /** Whether list is loading */ isLoading?: boolean; /** Error to display */ error?: Error | null; /** Called when a client is clicked */ onClientClick?: (client: OAuthClientInterface) => void; /** Called when create button is clicked */ onCreateClick?: () => void; /** Called when edit is clicked on a client */ onEditClick?: (client: OAuthClientInterface) => void; /** Called when delete is clicked on a client */ onDeleteClick?: (client: OAuthClientInterface) => void; /** Message to show when list is empty */ emptyStateMessage?: string; /** Title for the list */ title?: string; } /** * Component for displaying a list of OAuth clients */ export function OAuthClientList({ clients, isLoading = false, error, onClientClick, onCreateClick, onEditClick, onDeleteClick, emptyStateMessage = "No OAuth applications yet. Create one to get started.", title = "OAuth Applications", }: OAuthClientListProps) { // Loading state if (isLoading && clients.length === 0) { return (
{error.message}
{emptyStateMessage}
{onCreateClick && ( )}