import { GlobeLock, Group, User2 } from 'lucide-react'; import React from 'react'; import { Form } from 'react-router'; import Button from '~/components/Button'; import TableList from '~/components/TableList'; import cn from '~/utils/cn'; interface RestrictionProps { children: React.ReactNode; type: 'domain' | 'group' | 'user'; values: string[]; isDisabled?: boolean; } export default function RestrictionTable({ children, type, values, isDisabled, }: RestrictionProps) { return (

Permitted {type.charAt(0).toUpperCase() + type.slice(1)}s

{values.length > 0 ? ( values.map((value) => ( {type === 'domain' ? (

{''} @ {value}

) : (

{value}

)}
)) ) : ( {iconForType(type)}

All {type}s are permitted to authenticate.

)}
{children}
); } function iconForType(type: 'domain' | 'group' | 'user') { if (type === 'domain') { return ; } if (type === 'group') { return ; } return ; }