Skip to content

Commit 8f79ab8

Browse files
committed
fix: move texts and style to general files
1 parent 3f526bb commit 8f79ab8

File tree

4 files changed

+11
-6
lines changed

4 files changed

+11
-6
lines changed

src/app/components/CSVButton/CSVButton.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { parse } from "json2csv";
33
import { WordData } from "@/app/general/interfaces";
44
import { styles } from "@/app/components/CSVButton/CSVButton.style";
55
import CustomButton from "@/app/components/CustomButton";
6+
import { DOWNLOAD_RESULTS } from "@/app/general/constants";
67

78
export default function CSVButton({ queryWords }: { queryWords: WordData[] }) {
89
const handleDownload = () => {
@@ -15,7 +16,7 @@ export default function CSVButton({ queryWords }: { queryWords: WordData[] }) {
1516
<CustomButton
1617
onClick={handleDownload}
1718
sx={styles.button}
18-
text="Download Results"
19+
text={DOWNLOAD_RESULTS}
1920
/>
2021
);
2122
}
Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const styles = {};
1+
export const styles = {
2+
button: { width: "120%" },
3+
};

src/app/components/ChatButton/ChatButton.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22
import { Grid } from "@mui/material";
33
import CustomButton from "@/app/components/CustomButton";
44
import SendIcon from "@mui/icons-material/Send";
5+
import { styles } from "./ChatButton.style";
6+
import { SEND } from "@/app/general/constants";
57

68
export default function ChatButton() {
79
return (
810
<Grid item xs={2}>
911
<CustomButton
10-
sx={{ width: "120%" }}
12+
sx={styles.button}
1113
endIcon={<SendIcon />}
1214
type="submit"
13-
text="Send"
15+
text={SEND}
1416
/>
1517
</Grid>
1618
);

src/app/general/constants.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export const NO_RESULTS_FOUND = "No results found";
2-
32
export const SAMPLE_SIZE = 5;
4-
53
export const ATTRIBUTES_BUTTON_TEXT = "Display Attributes";
64
export const SAMPLE_BUTTON_TEXT = "Display Data Sample";
75
export const NO_HELP_DESCRIPTION = "No help description available";
6+
export const DOWNLOAD_RESULTS = "Download Results";
7+
export const SEND = "Send";

0 commit comments

Comments
 (0)