Skip to content

Commit

Permalink
adjust display and prefer Dropdown
Browse files Browse the repository at this point in the history
  • Loading branch information
aeltorio committed Oct 1, 2024
1 parent 1b3c080 commit f2eb793
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/aipane/AIPrompt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,4 @@ export interface AIModel {
id: string;
name: string;
default: boolean;
}
}
4 changes: 2 additions & 2 deletions src/aipane/components/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ const useStyles = makeStyles({
display: "flex",
flexDirection: "column",
alignItems: "center",
paddingBottom: "30px",
paddingTop: "100px",
paddingBottom: "10px",
paddingTop: "50px",
backgroundColor: tokens.colorNeutralBackground3,
},
message: {
Expand Down
11 changes: 6 additions & 5 deletions src/aipane/components/HeroComboPrompts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
=========================================================
*/
import * as React from "react";
import { Combobox, Label, makeStyles, Option, useId } from "@fluentui/react-components";
import { Dropdown, Label, makeStyles, Option, useId } from "@fluentui/react-components";
import { useState, useEffect } from "react";
import config from "../../config.json"; // Assurez-vous que le chemin est correct
import type { AIPrompt } from "../AIPrompt";
Expand Down Expand Up @@ -49,18 +49,19 @@ const HeroComboPrompts: React.FC<HeroComboPromptsProps> = ({ onChange }) => {
<Label htmlFor={inputId} size="large">
AI Prompt
</Label>
<Combobox
<Dropdown
className={styles.combobox}
id={inputId}
placeholder="Select a prompt"
onActiveOptionChange={handleChange}
defaultSelectedOptions={[config.prompts[0].id]}
defaultValue={config.prompts[0].summary}
>
{config.prompts.map((option: AIPrompt) => (
<Option id={option.id} value={option.id} key={option.id}>
<Option value={option.id} key={option.id}>
{option.summary}
</Option>
))}
</Combobox>
</Dropdown>
</div>
);
};
Expand Down
4 changes: 2 additions & 2 deletions src/aipane/components/HeroModels.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ interface HeroModelsProps {
}

function getDefaultModel(): AIModel {
return config.models.filter((model: AIModel) => model.default)[0];
return config.models.filter((model: AIModel) => model.default)[0];
}
const useStyles = makeStyles({
root: {
Expand Down Expand Up @@ -61,7 +61,7 @@ const HeroModels: React.FC<HeroModelsProps> = ({ onChange }) => {
onActiveOptionChange={handleChange}
onChange={handleChange}
>
{config.models.map((option:AIModel) => (
{config.models.map((option: AIModel) => (
<Option value={option.id} key={option.id}>
{option.name}
</Option>
Expand Down
2 changes: 1 addition & 1 deletion src/aipane/components/TextInsertion.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const useStyles = makeStyles({
textPromptAndInsertion: {
display: "flex",
flexDirection: "column",
alignItems: "center",
alignItems: "center",
gap: "2px",
margin: "10px",
},
Expand Down

0 comments on commit f2eb793

Please sign in to comment.