dify/web/app/components/base/svg/index.stories.tsx
非法操作 f092bc1912
chore: add more stories (#27403)
Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>
2025-10-29 14:33:43 +08:00

37 lines
1.1 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/nextjs'
import { useState } from 'react'
import SVGBtn from '.'
const SvgToggleDemo = () => {
const [isSVG, setIsSVG] = useState(false)
return (
<div className="flex w-full max-w-xs flex-col items-center gap-4 rounded-2xl border border-divider-subtle bg-components-panel-bg p-6">
<p className="text-xs uppercase tracking-[0.18em] text-text-tertiary">SVG toggle</p>
<SVGBtn isSVG={isSVG} setIsSVG={setIsSVG} />
<span className="text-xs text-text-secondary">
Mode: <code className="rounded bg-background-default px-2 py-1 text-[11px]">{isSVG ? 'SVG' : 'PNG'}</code>
</span>
</div>
)
}
const meta = {
title: 'Base/General/SVGBtn',
component: SvgToggleDemo,
parameters: {
layout: 'centered',
docs: {
description: {
component: 'Small toggle used in icon pickers to switch between SVG and bitmap assets.',
},
},
},
tags: ['autodocs'],
} satisfies Meta<typeof SvgToggleDemo>
export default meta
type Story = StoryObj<typeof meta>
export const Playground: Story = {}