import { PolicyCard } from '@/components/policies/PolicyCard';
import { PolicyEmptyState } from '@/components/policies/PolicyEmptyState';
import type { PoliciesViewProps } from '@/components/policies/types';

export function PolicyList({ state, actions }: PoliciesViewProps) {
  if (state.filteredPolicies.length === 0) {
    return <PolicyEmptyState />;
  }

  return (
    <div className="space-y-3">
      {state.filteredPolicies.map((policy) => (
        <PolicyCard key={policy.id} policy={policy} state={state} actions={actions} />
      ))}
    </div>
  );
}
