Formatted some client files
This commit is contained in:
@@ -7,7 +7,6 @@ import dayjs from "dayjs";
|
||||
import utc from "dayjs/plugin/utc";
|
||||
import { IFilament } from "./model";
|
||||
import { enrichText } from "../../utils/parsing";
|
||||
import { IVendor } from "../vendors/model";
|
||||
import { useNavigate } from "react-router-dom";
|
||||
dayjs.extend(utc);
|
||||
|
||||
@@ -34,19 +33,22 @@ export const FilamentShow: React.FC<IResourceComponentsProps> = () => {
|
||||
const gotoVendor = (): undefined => {
|
||||
const URL = `/vendor/show/${record?.vendor?.id}`;
|
||||
navigate(URL);
|
||||
}
|
||||
};
|
||||
|
||||
const gotoSpools = (): undefined => {
|
||||
const URL = `/spool#filters=[{"field":"filament.id","operator":"in","value":[${record?.id}]}]`
|
||||
const URL = `/spool#filters=[{"field":"filament.id","operator":"in","value":[${record?.id}]}]`;
|
||||
navigate(URL);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<Show isLoading={isLoading} title={record ? formatTitle(record) : ""}>
|
||||
<Title level={5}>{t("filament.fields.id")}</Title>
|
||||
<NumberField value={record?.id ?? ""} />
|
||||
<Title level={5}>{t("filament.fields.vendor")}</Title>
|
||||
<button onClick={gotoVendor} style={{ background: 'none', border: 'none', color: 'blue', cursor: 'pointer', paddingLeft: 0 }}>
|
||||
<button
|
||||
onClick={gotoVendor}
|
||||
style={{ background: "none", border: "none", color: "blue", cursor: "pointer", paddingLeft: 0 }}
|
||||
>
|
||||
{record ? record.vendor?.name : ""}
|
||||
</button>
|
||||
<Title level={5}>{t("filament.fields.registered")}</Title>
|
||||
@@ -118,10 +120,13 @@ export const FilamentShow: React.FC<IResourceComponentsProps> = () => {
|
||||
<Title level={5}>{t("filament.fields.comment")}</Title>
|
||||
<TextField value={enrichText(record?.comment)} />
|
||||
<Title level={5}>{t("filament.fields.spools")}</Title>
|
||||
<button onClick={gotoSpools} style={{ background: 'none', border: 'none', color: 'blue', cursor: 'pointer', paddingLeft: 0 }}>
|
||||
<button
|
||||
onClick={gotoSpools}
|
||||
style={{ background: "none", border: "none", color: "blue", cursor: "pointer", paddingLeft: 0 }}
|
||||
>
|
||||
{record ? formatTitle(record) : ""}
|
||||
</button>
|
||||
</Show >
|
||||
</Show>
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user