import React from 'react';
import { useImmer } from 'use-immer';
import type { IntentType, SizeType } from '../const';
import { daisy } from '../utils/daisy';
export const DaisyThemeDemo = () => {
const [state, update] = useImmer<{ size?: SizeType; intent?: IntentType }>({
size: undefined,
intent: undefined,
});
const { size, intent } = state;
const btnx = daisy('btn', { size, intent });
return (
- {
update({ ...state, size: undefined });
}}
>
Default
{sizes.map((v) => {
return (
- {
update({ ...state, size: v });
}}
>
{v}
);
})}
- {
update({ ...state, intent: undefined });
}}
>
Default
{intents.map((v) => {
return (
- {
update({ ...state, intent: v });
}}
>
{v}
);
})}
div]:px-4'}>
button
{intents.map((v) => (
))}
{sizes.map((v) => (
))}
badge
neutral
primary
secondary
accent
ghost
info
success
warning
error
radial-progress
0%
10%
primary
35%
10rem/2px
10rem/2rem
);
};
const intents: IntentType[] = ['primary', 'secondary', 'accent', 'info', 'success', 'warning', 'error'];
const sizes: SizeType[] = ['xs', 'sm', 'md', 'lg'];