import React from 'react';
import { List, Datagrid, TextField, DateField, EditButton, SelectInput } from 'react-admin';

export const SubscriptionList = () => (
    <List filters={[<SelectInput source="status" choices={[
        { id: 'active', name: 'Active' },
        { id: 'expired', name: 'Expired' },
        { id: 'cancelled', name: 'Cancelled' },
    ]} alwaysOn />]}>
        <Datagrid rowClick="edit">
            <TextField source="user_id" />
            <TextField source="plan" />
            <TextField source="status" />
            <DateField source="started_at" />
            <DateField source="expires_at" />
            <EditButton />
        </Datagrid>
    </List>
);