UNPKG

@mayank1513/nthul

Version:

Unleash the Power of React Server Components! Use multiple themes on your site with confidence, without losing any advantages of React Server Components.

2 lines (1 loc) 499 B
import{a as o}from"./chunk-C64GYUGA.mjs";import{jsx as n}from"react/jsx-runtime";var h=({targetId:r,skipSystem:s,size:c,...l})=>{let{setColorSchemePreference:e,resolvedColorScheme:i,colorSchemePreference:t}=o(r),m=()=>{switch(t){case"dark":e("light");break;case"light":e(s?"dark":"system");break;case"system":default:e("dark");break}};return n("button",{className:["nthul--color-switch",i,t==="system"?"system":""].join(" "),...l,onClick:m,style:{"--size":`${c}px`},type:"button"})};export{h as a};