Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,16 @@ import { Button, useDisclosure } from "@chakra-ui/react";
import { useTranslations } from "next-intl";
import { PlusIcon } from "lucide-react";
import { PreWrittenPhrasesModal } from "app/[locale]/resumes/[id]/_components/_sections/PreWrittenPhrasesModal";
import { PHRASES } from "lib/phrases";
import { Phrase } from "types";

type Props = {
phrases: Phrase[];
currentPhrases: string;
onChange: (_phrase: string, _isChecked: boolean) => void;
};

function AddPreWrittenPhrasesButton(props: Props) {
const { currentPhrases, onChange } = props;
const { phrases, currentPhrases, onChange } = props;
const t = useTranslations();
const { isOpen, onOpen, onClose } = useDisclosure();

Expand All @@ -28,7 +29,7 @@ function AddPreWrittenPhrasesButton(props: Props) {
<PreWrittenPhrasesModal
isOpen={isOpen}
value={currentPhrases}
phrases={PHRASES.SUMMARY}
phrases={phrases}
onClose={onClose}
onChange={onChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import { useLocalStorage } from "hooks/useLocalStorage";
import { SectionHeader } from "app/[locale]/resumes/[id]/_components/_sections/SectionHeader";
import { AddPreWrittenPhrasesButton } from "app/[locale]/resumes/[id]/_components/_sections/AddPreWrittenPhrasesButton";
import { ProfilePicture } from "app/[locale]/resumes/[id]/_components/_sections/ProfilePicture";
import { PHRASES } from "lib/phrases";

function ProfilePictureGridItem() {
const { control } = useFormContext();
Expand Down Expand Up @@ -69,6 +70,7 @@ function SummaryGridItem() {
/>
</FormControl>
<AddPreWrittenPhrasesButton
phrases={PHRASES.SUMMARY}
currentPhrases={summary}
onChange={handleOnPhraseChange}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import { Section } from "types";
import { utils } from "lib/utils";
import { SectionHeader } from "app/[locale]/resumes/[id]/_components/_sections/SectionHeader";
import { AddPreWrittenPhrasesButton } from "app/[locale]/resumes/[id]/_components/_sections/AddPreWrittenPhrasesButton";
import { PHRASES } from "lib/phrases";

type Props = {
id: string;
Expand Down Expand Up @@ -92,6 +93,7 @@ function Description({ index, nestIndex, isEmployment }) {
</FormControl>
{isEmployment ? (
<AddPreWrittenPhrasesButton
phrases={PHRASES.EMPLOYMENT}
currentPhrases={description}
onChange={handleOnPhraseChange}
/>
Expand Down