siakad-itm/resources/js/components/active-status-switch.tsx
Yoga Pangestu 5994f38f01 feat: implement permission checks for academic terms, courses, departments, and user management
- 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.
2026-08-30 23:27:31 +07:00

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>
);
}