feat: hide personal data columns for dak_mitarbeiter in case list

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
CCS Admin 2026-02-26 16:09:43 +00:00
parent 3e9448ab33
commit f2219b487b

View file

@ -52,6 +52,7 @@ interface CasesPageProps {
} }
export function CasesPage({ pendingIcdOnly = false }: CasesPageProps) { export function CasesPage({ pendingIcdOnly = false }: CasesPageProps) {
const { isAdmin } = useAuth()
const currentYear = new Date().getFullYear() const currentYear = new Date().getFullYear()
const [search, setSearch] = useState('') const [search, setSearch] = useState('')
const [debouncedSearch, setDebouncedSearch] = useState('') const [debouncedSearch, setDebouncedSearch] = useState('')
@ -140,7 +141,7 @@ export function CasesPage({ pendingIcdOnly = false }: CasesPageProps) {
<div className="relative flex-1 min-w-[200px] max-w-sm"> <div className="relative flex-1 min-w-[200px] max-w-sm">
<Search className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" /> <Search className="absolute left-3 top-1/2 -translate-y-1/2 size-4 text-muted-foreground" />
<Input <Input
placeholder="Suche nach Name, Fall-ID..." placeholder={isAdmin ? "Suche nach Name, Fall-ID, KVNR..." : "Suche nach Fall-ID, KVNR..."}
value={search} value={search}
onChange={(e) => handleSearchChange(e.target.value)} onChange={(e) => handleSearchChange(e.target.value)}
className="pl-9" className="pl-9"
@ -194,8 +195,8 @@ export function CasesPage({ pendingIcdOnly = false }: CasesPageProps) {
<TableRow> <TableRow>
<TableHead>Fall-ID</TableHead> <TableHead>Fall-ID</TableHead>
<TableHead>Datum</TableHead> <TableHead>Datum</TableHead>
<TableHead>Nachname</TableHead> {isAdmin && <TableHead>Nachname</TableHead>}
<TableHead>Vorname</TableHead> {isAdmin && <TableHead>Vorname</TableHead>}
<TableHead>KVNR</TableHead> <TableHead>KVNR</TableHead>
<TableHead>Fallgruppe</TableHead> <TableHead>Fallgruppe</TableHead>
<TableHead>ICD</TableHead> <TableHead>ICD</TableHead>
@ -214,8 +215,8 @@ export function CasesPage({ pendingIcdOnly = false }: CasesPageProps) {
{c.fall_id || '-'} {c.fall_id || '-'}
</TableCell> </TableCell>
<TableCell>{formatDate(c.datum)}</TableCell> <TableCell>{formatDate(c.datum)}</TableCell>
<TableCell className="font-medium">{c.nachname}</TableCell> {isAdmin && <TableCell className="font-medium">{c.nachname}</TableCell>}
<TableCell>{c.vorname || '-'}</TableCell> {isAdmin && <TableCell>{c.vorname || '-'}</TableCell>}
<TableCell className="font-mono text-sm"> <TableCell className="font-mono text-sm">
{c.kvnr || '-'} {c.kvnr || '-'}
</TableCell> </TableCell>