Skip to content

Commit

Permalink
fix: make the stories file pass TS checks
Browse files Browse the repository at this point in the history
  • Loading branch information
florianstancioiu committed Mar 28, 2024
1 parent 4c0faca commit 83c32f5
Showing 1 changed file with 14 additions and 10 deletions.
24 changes: 14 additions & 10 deletions stories/cosmoz-treenode.stories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@ import '../src/cosmoz-treenode';
import { TreeData, Tree } from '@neovici/cosmoz-tree/cosmoz-tree.js';

export interface TreeNodeTemplateArgs {
keyProperty: string;
keyValue: string;
valueProperty: string;
pathSeparator: string;
hideFromRoot: boolean;
showMaxNodes: number;
fallback: string;
keyProperty?: string;
keyValue?: string;
valueProperty?: string;
pathSeparator?: string;
hideFromRoot?: boolean;
showMaxNodes?: number;
fallback?: string;
}

const TreeNodeTemplate = (
Expand All @@ -27,11 +27,15 @@ const TreeNodeTemplate = (
loaded: { treeJson },
}: {
loaded: {
treeJson: TreeData;
treeJson?: TreeData;
};
},
) => {
const ownerTree = new Tree(treeJson);
let ownerTree;

if (treeJson !== undefined) {
ownerTree = new Tree(treeJson);
}

return html`
<cosmoz-treenode
Expand Down Expand Up @@ -81,7 +85,7 @@ const meta: Meta = {

export default meta;

type Story = StoryObj<typeof meta>;
type Story = StoryObj;

export const CompanyKtwoktqtxv: Story = {
args: {
Expand Down

0 comments on commit 83c32f5

Please sign in to comment.