- Added permission checks for creating, updating, and deleting academic terms, courses, and departments. - Updated the routes to enforce permissions for various actions in the admin panel. - Enhanced user management by adding permissions for administrators, lecturers, and students. - Refactored components to conditionally render actions based on user permissions. - Updated the auth type to include optional permissions array for user roles.
27 lines
653 B
TypeScript
27 lines
653 B
TypeScript
import { Switch } from '@/components/ui/switch';
|
|
|
|
type ActiveStatusSwitchProps = {
|
|
isActive: boolean;
|
|
onChange: (isActive: boolean) => void;
|
|
disabled?: boolean;
|
|
};
|
|
|
|
export function ActiveStatusSwitch({
|
|
isActive,
|
|
onChange,
|
|
disabled,
|
|
}: ActiveStatusSwitchProps) {
|
|
return (
|
|
<div className="flex items-center gap-2">
|
|
<Switch
|
|
checked={isActive}
|
|
onCheckedChange={onChange}
|
|
disabled={disabled}
|
|
/>
|
|
<span className="text-sm text-muted-foreground">
|
|
{isActive ? 'Aktif' : 'Nonaktif'}
|
|
</span>
|
|
</div>
|
|
);
|
|
}
|