Sha256: ff600532a7235e7a94f16bc5f4cd96a69670aa561d5c3788405b09f26900fa8b

Contents?: true

Size: 702 Bytes

Versions: 1

Compression:

Stored size: 702 Bytes

Contents

import { allTags, isEnabled } from "./useTags";

import AddTagForm from "./AddTagForm";
import Tag from "./Tag";
import * as Tags from "../../types/Tags";

type Props = {
  name: string;
  state: Tags.State;
  dispatch: React.Dispatch<Tags.Action>;
};

export default function Editor(props: Props) {
  const { name, state, dispatch } = props;

  return (
    <div className="tag-editor">
      <input type="hidden" name={name} value={JSON.stringify(state.enabled)} />
      {allTags(state).map((t) => (
        <Tag
          key={t}
          tag={t}
          enabled={isEnabled(t, state)}
          dispatch={dispatch}
        />
      ))}
      <AddTagForm dispatch={dispatch} />
    </div>
  );
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pages_core-3.15.5 app/javascript/components/TagEditor/Editor.tsx