mirror of
https://github.com/open-webui/computer.git
synced 2026-11-30 00:45:14 -05:00
refac
This commit is contained in:
1 parent
59a5325286
commit
0f1d358bec
5 files changed
+6
-27
No files matched your search
@@ -0,0 +1,25 @@
|
||||
<script lang="ts">
|
||||
interface Props {
|
||||
value: boolean;
|
||||
onchange?: (value: boolean) => void;
|
||||
disabled?: boolean;
|
||||
}
|
||||
let { value, onchange, disabled = false }: Props = $props();
|
||||
</script>
|
||||
|
||||
<button
|
||||
type="button"
|
||||
class="relative w-7 h-4 rounded-full transition-colors duration-150 shrink-0
|
||||
{value ? 'bg-gray-900 dark:bg-white' : 'bg-gray-300 dark:bg-gray-700'}"
|
||||
onclick={() => onchange?.(!value)}
|
||||
{disabled}
|
||||
role="switch"
|
||||
aria-checked={value}
|
||||
>
|
||||
<span
|
||||
class="absolute top-[2px] w-3 h-3 rounded-full transition-all duration-150
|
||||
{value
|
||||
? 'left-[14px] bg-white dark:bg-black'
|
||||
: 'left-[2px] bg-white dark:bg-gray-500'}"
|
||||
></span>
|
||||
</button>
|
||||
Reference in new issue
Block a user