Remove unused OfflineIndicator, OfflineSyncDetails, and OfflineSyncManager components

- Deleted obsolete offline-related components as they are no longer in use.
- Simplified imports and removed related context dependencies.
- Updated synchronization and toggle switch handling in `CharacterComponent`, `WorldSetting`, and `LocationComponent` to improve consistency.
This commit is contained in:
natreex
2026-01-15 19:26:09 -05:00
parent 2e6b30c632
commit da03f221ae
9 changed files with 68 additions and 608 deletions

View File

@@ -1,59 +1,29 @@
'use client';
import {Dispatch, SetStateAction} from 'react';
'use client'
import React from "react";
interface ToggleSwitchProps {
enabled: boolean;
setEnabled: Dispatch<SetStateAction<boolean>>;
label?: string;
description?: string;
checked: boolean;
onChange: (checked: boolean) => void;
disabled?: boolean;
}
export default function ToggleSwitch({
enabled,
setEnabled,
label,
description,
disabled = false
}: ToggleSwitchProps) {
function handleToggle(): void {
if (!disabled) {
setEnabled(!enabled);
}
}
export default function ToggleSwitch({checked, onChange, disabled = false}: ToggleSwitchProps) {
return (
<div className="flex items-center justify-between">
<div className="flex flex-col">
{label && (
<span className="text-text-primary font-medium">{label}</span>
)}
{description && (
<span className="text-text-secondary text-sm mt-1">{description}</span>
)}
</div>
<button
type="button"
onClick={handleToggle}
disabled={disabled}
className={`
relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent
transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-primary focus:ring-offset-2
${enabled ? 'bg-primary' : 'bg-secondary'}
${disabled ? 'opacity-50 cursor-not-allowed' : ''}
`}
role="switch"
aria-checked={enabled}
>
<span
className={`
pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0
transition duration-200 ease-in-out
${enabled ? 'translate-x-5' : 'translate-x-0'}
`}
/>
</button>
</div>
<button
type="button"
role="switch"
aria-checked={checked}
disabled={disabled}
onClick={(): void => onChange(!checked)}
className={`relative inline-flex h-6 w-11 items-center rounded-full transition-colors duration-200 ${
checked ? 'bg-primary' : 'bg-secondary'
} ${disabled ? 'opacity-50 cursor-not-allowed' : 'cursor-pointer'}`}
>
<span
className={`inline-block h-4 w-4 transform rounded-full bg-white transition-transform duration-200 ${
checked ? 'translate-x-6' : 'translate-x-1'
}`}
/>
</button>
);
}