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 @@ -96,6 +96,24 @@ const UpdateAIModelMutation: any = graphql(`
}
`);

const LANGUAGE_OPTIONS = [
{ label: 'English', value: 'en' },
{ label: 'Hindi', value: 'hi' },
{ label: 'Spanish', value: 'es' },
{ label: 'French', value: 'fr' },
{ label: 'German', value: 'de' },
{ label: 'Chinese', value: 'zh' },
{ label: 'Japanese', value: 'ja' },
{ label: 'Korean', value: 'ko' },
{ label: 'Arabic', value: 'ar' },
{ label: 'Portuguese', value: 'pt' },
{ label: 'Russian', value: 'ru' },
{ label: 'Tamil', value: 'ta' },
{ label: 'Telugu', value: 'te' },
{ label: 'Bengali', value: 'bn' },
{ label: 'Marathi', value: 'mr' },
];

export default function AIModelDetailsPage() {
const params = useParams<{
entityType: string;
Expand Down Expand Up @@ -273,7 +291,8 @@ export default function AIModelDetailsPage() {
maxTokens: model.maxTokens?.toString() || '',
supportedLanguages:
model.supportedLanguages?.map((l: string) => ({
label: l,
label:
LANGUAGE_OPTIONS.find((option) => option.value === l)?.label || l,
value: l,
})) || [],
modelWebsite: metadata.modelWebsite || '',
Expand All @@ -289,6 +308,7 @@ export default function AIModelDetailsPage() {
}, [model]);

const handleInputChange = (field: string, value: any) => {
console.log('handleInputChange', field, value);
setFormData((prev) => ({ ...prev, [field]: value }));
setStatus('unsaved');
};
Expand Down Expand Up @@ -324,7 +344,9 @@ export default function AIModelDetailsPage() {

// Ensure access type is always 'open' (required field)
if (dataToUse.accessType !== 'open') {
toast('Open access is required for all models',{id: OPEN_ACCESS_REQUIRED_TOAST_ID});
toast('Open access is required for all models', {
id: OPEN_ACCESS_REQUIRED_TOAST_ID,
});
setStatus('unsaved');
return;
}
Expand Down Expand Up @@ -396,23 +418,7 @@ export default function AIModelDetailsPage() {
{ label: '131072', value: '131072' },
];

const languageOptions = [
{ label: 'English', value: 'en' },
{ label: 'Hindi', value: 'hi' },
{ label: 'Spanish', value: 'es' },
{ label: 'French', value: 'fr' },
{ label: 'German', value: 'de' },
{ label: 'Chinese', value: 'zh' },
{ label: 'Japanese', value: 'ja' },
{ label: 'Korean', value: 'ko' },
{ label: 'Arabic', value: 'ar' },
{ label: 'Portuguese', value: 'pt' },
{ label: 'Russian', value: 'ru' },
{ label: 'Tamil', value: 'ta' },
{ label: 'Telugu', value: 'te' },
{ label: 'Bengali', value: 'bn' },
{ label: 'Marathi', value: 'mr' },
];
const languageOptions = LANGUAGE_OPTIONS;

const licenseOptions = [
{ label: 'Click to select from dropdown', value: '' },
Expand All @@ -434,7 +440,7 @@ export default function AIModelDetailsPage() {
</div>
);
}
const OPEN_ACCESS_REQUIRED_TOAST_ID = SAVE_SUCCESS_TOAST_ID;
const OPEN_ACCESS_REQUIRED_TOAST_ID = SAVE_SUCCESS_TOAST_ID;
return (
<div className="flex flex-col gap-4 py-6">
{/* Model Type & Domain - side by side */}
Expand Down Expand Up @@ -536,6 +542,7 @@ const OPEN_ACCESS_REQUIRED_TOAST_ID = SAVE_SUCCESS_TOAST_ID;
label="Tags"
creatable
selectedValue={formData.tags}
requiredIndicator
onChange={(value) => {
setIsTagsListUpdated(true);
handleInputChange('tags', value);
Expand Down Expand Up @@ -599,6 +606,7 @@ const OPEN_ACCESS_REQUIRED_TOAST_ID = SAVE_SUCCESS_TOAST_ID;
}
key={`geographies-${getGeographiesList.data?.geographies?.length || 0}-${formData.geographies.length}`}
label="Locations / Geography"
requiredIndicator
selectedValue={formData.geographies}
onChange={(value) => {
handleInputChange('geographies', value);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -393,7 +393,7 @@ export default function PublishPage() {
{meta.label}:
</Text>
<Text
variant="bodyLg"
variant="bodyMd"
className="lg:basis-4/5"
>
{meta.value}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const Details = ({ data }: { data: any }) => {
className="text-primaryBlue underline"
href={data.collaboratives[0].platformUrl}
>
<Text className="underline" color="highlight" variant="bodyLg">
<Text className="underline" color="highlight" variant="bodyMd">
{platformTitle?.trim() ? platformTitle : 'Visit Platform'}
</Text>
</Link>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const Details = ({ data }: { data: any }) => {
<Text
className="underline"
color="highlight"
variant="bodyLg"
variant="bodyMd"
>
{platformTitle?.trim() ? platformTitle : 'Visit Platform'}
</Text>
Expand Down
33 changes: 17 additions & 16 deletions components/RichTextRenderer/RichTextRenderer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
'use client';

import React from 'react';

import 'react-quill-new/dist/quill.snow.css';

interface RichTextRendererProps {
Expand Down Expand Up @@ -36,32 +37,32 @@ const RichTextRenderer: React.FC<RichTextRendererProps> = ({
overflow-wrap: anywhere;
word-break: break-word;
padding: 0;
font-size: 16px;
font-size: 14px;
line-height: 1.6;
}

.rich-text-content .ql-editor p {
margin-bottom: 1em;
}

.rich-text-content .ql-editor h1 {
font-size: 2em;
font-weight: bold;
margin-bottom: 0.5em;
}

.rich-text-content .ql-editor h2 {
font-size: 1.5em;
font-weight: bold;
margin-bottom: 0.5em;
}

.rich-text-content .ql-editor h3 {
font-size: 1.25em;
font-weight: bold;
margin-bottom: 0.5em;
}

.rich-text-content .ql-editor ul,
.rich-text-content .ql-editor ol {
list-style-position: outside;
Expand All @@ -80,7 +81,7 @@ const RichTextRenderer: React.FC<RichTextRendererProps> = ({
.rich-text-content .ql-editor ol {
list-style-type: decimal !important;
}

.rich-text-content .ql-editor li {
margin-bottom: 0.25em;
}
Expand All @@ -99,43 +100,43 @@ const RichTextRenderer: React.FC<RichTextRendererProps> = ({
.rich-text-content .ql-editor li:not([data-list])::before {
content: none !important;
}

.rich-text-content .ql-editor a {
color: #3b82f6;
text-decoration: underline;
}

.rich-text-content .ql-editor a:hover {
color: #2563eb;
}

.rich-text-content.text-white .ql-editor a {
color: #60a5fa;
}

.rich-text-content.text-white .ql-editor a:hover {
color: #93c5fd;
}

.rich-text-content .ql-editor img {
max-width: 100%;
height: auto;
margin: 1em 0;
}

.rich-text-content .ql-editor strong,
.rich-text-content .ql-editor b {
font-weight: 700 !important;
}

.rich-text-content .ql-editor em {
font-style: italic;
}

.rich-text-content .ql-editor u {
text-decoration: underline;
}

.rich-text-content .ql-editor s {
text-decoration: line-through;
}
Expand Down
Loading