Skip to content

Commit

Permalink
chore: Create shared Category type (#3724)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Sep 24, 2024
1 parent 9ca6c8b commit 4ba1baa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor.planx.uk/src/@planx/components/Checklist/Editor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,16 @@ import InputRowItem from "ui/shared/InputRowItem";
import { Option, parseMoreInformation } from "../shared";
import PermissionSelect from "../shared/PermissionSelect";
import { ICONS, InternalNotes, MoreInformation } from "../ui";
import type { Checklist, Group } from "./model";
import type { Category, Checklist, Group } from "./model";
import { toggleExpandableChecklist } from "./model";

interface ChecklistProps extends Checklist {
export interface ChecklistProps extends Checklist {
text: string;
handleSubmit?: Function;
node?: {
data?: {
allRequired?: boolean;
categories?: any;
categories?: Array<Category>;
definitionImg?: string;
description?: string;
fn?: string;
Expand Down
6 changes: 6 additions & 0 deletions editor.planx.uk/src/@planx/components/Checklist/model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ export interface Group<T> {
children: Array<T>;
}

export interface Category {
title: string;
count: number;
}

export interface Checklist extends MoreInformation {
fn?: string;
description?: string;
Expand All @@ -16,6 +21,7 @@ export interface Checklist extends MoreInformation {
groupedOptions?: Array<Group<Option>>;
img?: string;
allRequired?: boolean;
categories?: Array<Category>;
}

interface ChecklistExpandableProps {
Expand Down

0 comments on commit 4ba1baa

Please sign in to comment.