ChatTodoList

Data Display

항목별 상태를 보여주는 할 일 목록.

Usage

항목마다 상태가 순서와 무관하게 갈리는 할 일 목록을 보여줄 때 사용한다.

import

import

import { ChatTodoList } from '@mildang/design-system/unofficial/Chat';

API Reference

ChatTodoList Props

Prop

Type

Default

items
필수

readonly TodoItemData[]

지정 안 함

labels

Partial<ChatTodoListLabels>

지정 안 함

revision

number

지정 안 함

같은 패밀리

@mildang/design-system/unofficial/Chat 에서 같이 내보내는 컴포넌트다.

예제

기본

import type { ComponentProps } from 'react';
import { ChatTodoList } from '@mildang/design-system/unofficial/Chat';
type Props = ComponentProps<typeof ChatTodoList>;
const DEFAULT_ARGS: Props = { items: [{ id: 'a', text: '결제 실패 로그 수집', status: 'done' }, { id: 'b', text: '재현 케이스 최소화', status: 'done' }, { id: 'c', text: '웹훅 재시도 큐 확인', status: 'active' }, { id: 'd', text: '수정 후 스테이징 배포', status: 'pending' }, { id: 'e', text: 'CS 팀에 공유', status: 'pending' }], maxWidth: '360px' };
export default function TodoListDefaultExample(props: Partial<Props> = {}) { return <ChatTodoList {...DEFAULT_ARGS} {...props} />; }

개정 번호

import type { ComponentProps } from 'react';
import { ChatTodoList } from '@mildang/design-system/unofficial/Chat';
type Props = ComponentProps<typeof ChatTodoList>;
const ITEMS: Props['items'] = [{ id: 'a', text: '결제 실패 로그 수집', status: 'done' }, { id: 'b', text: '재현 케이스 최소화', status: 'done' }, { id: 'c', text: '웹훅 재시도 큐 확인', status: 'active' }, { id: 'd', text: '수정 후 스테이징 배포', status: 'pending' }, { id: 'e', text: 'CS 팀에 공유', status: 'pending' }];
const DEFAULT_ARGS: Props = { items: ITEMS, revision: 3, maxWidth: '360px' };
export default function TodoListWithRevisionExample(props: Partial<Props> = {}) { return <ChatTodoList {...DEFAULT_ARGS} {...props} />; }

전부 완료

import type { ComponentProps } from 'react';
import { ChatTodoList } from '@mildang/design-system/unofficial/Chat';
type Props = ComponentProps<typeof ChatTodoList>;
const DEFAULT_ARGS: Props = { items: [{ id: 'a', text: '결제 실패 로그 수집', status: 'done' }, { id: 'b', text: '재현 케이스 최소화', status: 'done' }, { id: 'c', text: '웹훅 재시도 큐 확인', status: 'done' }, { id: 'd', text: '수정 후 스테이징 배포', status: 'done' }, { id: 'e', text: 'CS 팀에 공유', status: 'done' }], maxWidth: '360px' };
export default function TodoListAllDoneExample(props: Partial<Props> = {}) { return <ChatTodoList {...DEFAULT_ARGS} {...props} />; }

빈 목록

import type { ComponentProps } from 'react';
import { ChatTodoList } from '@mildang/design-system/unofficial/Chat';
type Props = ComponentProps<typeof ChatTodoList>;
const DEFAULT_ARGS: Props = { items: [], maxWidth: '360px' };
export default function TodoListEmptyExample(props: Partial<Props> = {}) { return <ChatTodoList {...DEFAULT_ARGS} {...props} />; }

문구 교체

import type { ComponentProps } from 'react';
import { ChatTodoList } from '@mildang/design-system/unofficial/Chat';
type Props = ComponentProps<typeof ChatTodoList>;
const DEFAULT_ARGS: Props = { items: [{ id: 'a', text: '결제 실패 로그 수집', status: 'done' }, { id: 'b', text: '재현 케이스 최소화', status: 'done' }, { id: 'c', text: '웹훅 재시도 큐 확인', status: 'active' }, { id: 'd', text: '수정 후 스테이징 배포', status: 'pending' }, { id: 'e', text: 'CS 팀에 공유', status: 'pending' }], revision: 2, maxWidth: '360px', labels: { title: 'Todos', count: (done, total, revision) => revision === undefined ? `${done}/${total}` : `${done}/${total} · rev ${revision}` } };
export default function TodoListCustomLabelsExample(props: Partial<Props> = {}) { return <ChatTodoList {...DEFAULT_ARGS} {...props} />; }