33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
|
|
import type { Meta, StoryObj } from "@storybook/react-vite";
|
||
|
|
import { ScoringPresetPicker, OMNIFANTASY_SCORING } from "./ScoringPresetPicker";
|
||
|
|
import { DEFAULT_SCORING_RULES } from "~/lib/scoring-types";
|
||
|
|
|
||
|
|
const meta: Meta<typeof ScoringPresetPicker> = {
|
||
|
|
title: "League/ScoringPresetPicker",
|
||
|
|
component: ScoringPresetPicker,
|
||
|
|
parameters: { layout: "padded" },
|
||
|
|
args: { onPresetChange: () => {}, onRulesChange: () => {} },
|
||
|
|
};
|
||
|
|
|
||
|
|
export default meta;
|
||
|
|
type Story = StoryObj<typeof ScoringPresetPicker>;
|
||
|
|
|
||
|
|
export const BracktDefault: Story = {
|
||
|
|
args: { preset: "brackt", rules: { ...DEFAULT_SCORING_RULES } },
|
||
|
|
};
|
||
|
|
|
||
|
|
export const OmnifantasyDefault: Story = {
|
||
|
|
args: { preset: "omnifantasy", rules: { ...OMNIFANTASY_SCORING } },
|
||
|
|
};
|
||
|
|
|
||
|
|
export const Custom: Story = {
|
||
|
|
args: {
|
||
|
|
preset: "custom",
|
||
|
|
rules: { pointsFor1st: 120, pointsFor2nd: 60, pointsFor3rd: 40, pointsFor4th: 30, pointsFor5th: 20, pointsFor6th: 15, pointsFor7th: 10, pointsFor8th: 5 },
|
||
|
|
},
|
||
|
|
};
|
||
|
|
|
||
|
|
export const Disabled: Story = {
|
||
|
|
args: { preset: "brackt", rules: { ...DEFAULT_SCORING_RULES }, disabled: true },
|
||
|
|
};
|